node使用koa框架,和mongodb一起用,有什么好的方案没?
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:19:06
0
1
688

koa框架搭好了,想根据不同的路由对mongodb数据库进行数据的操作。
阮一峰的例子

阮一峰的例子并不适合我。不知道有没有比较好的方案。

过去多啦不再A梦
过去多啦不再A梦

reply all(1)
左手右手慢动作

Perform data operations on mongodb database according to different routes

Are you talking about REST API? If so, there are already many third-party implementations. There is information about these frameworks in the document:
https://docs.mongodb.com/ecosystem/tools/http-interfaces/
Actually What framework to use and how to operate the database are two relatively independent issues. No matter what framework NodeJS uses to operate MongoDB, it cannot do without one of the two drivers: mongoose or node-mongodb native. As for when to call these drivers to access the database, it depends on the usage habits of KOA or other frameworks. So I don't see anything special that needs to be explained when using the koa framework and mongodb together. You can refine the problem a little more.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template