猫鼬和 mongoJS 有什么区别?我应该使用哪个? [英] What are difference of mongoose and mongoJS ? Which should I use?

查看:50
本文介绍了猫鼬和 mongoJS 有什么区别?我应该使用哪个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想知道,mongoose 和 mongoJS 有什么区别.而且,如果我们使用 mongoose 或 mongoJS 有什么优点和缺点?因为我们知道有很多依赖项用于连接 NodeJS 和 MongoDB.例如猫鼬和 mongoJS.

I just want to know, what are differences of mongoose and mongoJS. And, what the advantage and the lack if we use mongoose or mongoJS ? Because we know that are many depedency that use to connecting NodeJS and MongoDB. For example mongoose and mongoJS.

推荐答案

Mongoose 是更高级别的 Mongodb 接口,实际上使用 mongodb.js,即 MongoDB 驱动程序.问题不在于哪个更好或更差,对我们来说问题是

Mongoose is higher level interface to Mongodb and actually uses mongodb.js, the MongoDB driver. The question is not really which one is better or worse, the question for us is

> Mongoose 中 ODM 的好处是否大于弊端?

如果您正在寻找一种对象建模 (ODM) 工具,这样您就不必深入了解 Mongodb 的工作方式,那么 Mongoose 可能适合您.如果您想要一个快速的驱动程序并真正充分利用 Mongodb,那么请使用本机驱动程序.我们对 Mongodb 了如指掌,因此 Mongoose 会降低使用速度和我们的应用程序.

If you’re looking for an object modeling (ODM) tool so that you do not have to learn a lot about the way Mongodb works, then Mongoose is probably for you. If you want a fast driver and really get the most out of Mongodb, then use the native driver. We know our way around Mongodb so Mongoose would have slowed use down and our app.

这篇关于猫鼬和 mongoJS 有什么区别?我应该使用哪个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆