Need advice about which tool to choose?Ask the StackShare community!
Mongoid vs Mongoose: What are the differences?
Mongoid: Ruby ODM framework for MongoDB. The philosophy of Mongoid is to provide a familiar API to Ruby developers who have been using Active Record or Data Mapper, while leveraging the power of MongoDB's schemaless and performant document-based design, dynamic queries, and atomic modifier operations; Mongoose: MongoDB object modeling designed to work in an asynchronous environment. Let's face it, writing MongoDB validation, casting and business logic boilerplate is a drag. That's why we wrote Mongoose. Mongoose provides a straight-forward, schema-based solution to modeling your application data and includes built-in type casting, validation, query building, business logic hooks and more, out of the box.
Mongoid and Mongoose can be primarily classified as "Object Document Mapper (ODM)" tools.
Mongoid and Mongoose are both open source tools. Mongoose with 18.8K GitHub stars and 2.62K forks on GitHub appears to be more popular than Mongoid with 21 GitHub stars and 14 GitHub forks.
According to the StackShare community, Mongoose has a broader approval, being mentioned in 85 company stacks & 88 developers stacks; compared to Mongoid, which is listed in 7 company stacks and 7 developer stacks.
Pros of Mongoid
- Can be used without Rails1
- Supports Referenced and Embedded Associations1
- Easy to add 'created_at' and 'updated_at'' timestamps1
- Drop-in-and-forget replacement for activerecord1
Pros of Mongoose
- Several bad ideas mixed together17
- Well documented17
- JSON10
- Actually terrible documentation8
- Recommended and used by Valve. See steamworks docs2
- Can be used with passportjs for oauth1
- Yeah1
Sign up to add or upvote prosMake informed product decisions
Cons of Mongoid
Cons of Mongoose
- Model middleware/hooks are not user friendly3