简体   繁体   English

将MongoDB与Node.js一起使用的最佳方法?

[英]Best way to use MongoDB with Node.js?

I'm currently using MongoDB native and I'm familiar with it. 我目前正在使用MongoDB原生,我对它很熟悉。

Only thing I'm worrying about it is my source quality. 我唯一担心的是我的源质量。

Because of the native driver's nature, nested loop is inevitable. 由于本机驱动程序的本质,嵌套循环是不可避免的。

I have looked at Mongoose but I prefer schemaless way of using MongoDB. 我看过Mongoose,但我更喜欢使用MongoDB的无模式方式。

And I could not make a choice among 我无法做出选择

mongodb-native, mongoose (using mix type), mongolian, mongous, mongoskin

Or is there a way or tutorial to use MongoDB native with keeping the source DRY? 或者有一种方法或教程使用MongoDB本机保持源DRY?

mongodb-native will shortly be on the officially support driver list for mongoDB, so from that perspective, it is probably the safest choice. mongodb-native将很快出现在mongoDB的官方支持驱动程序列表中,因此从这个角度来看,它可能是最安全的选择。 Combine that (for quality of support) with the Raynos answer in the comments and that should make the choice for you. 将(支持质量)与评论中的Raynos答案相结合,应该为您做出选择。

I prefer async these days to Step 我喜欢这几天异步到步骤

https://github.com/caolan/async https://github.com/caolan/async

as it's got a lot more features letting you tailor your code a bit better. 因为它有更多功能,让您可以更好地定制代码。

Check this URL http://docs.mongodb.org/ecosystem/drivers/node-js/ mongoose also become official 查看此URL http://docs.mongodb.org/ecosystem/drivers/node-js/ mongoose也成为官方

Mongoose is the officially supported ODM for Node.js Mongoose是Node.js官方支持的ODM

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM