Need advice about which tool to choose?Ask the StackShare community!
LokiJS vs Mongoose: What are the differences?
Developers describe LokiJS as "In-memory JavaScript Datastore with Persistence". LokiJS is a document oriented database written in javascript, published under MIT License. Its purpose is to store javascript objects as documents in a nosql fashion and retrieve them with a similar mechanism. Runs in node (including cordova/phonegap and node-webkit), nativescript and the browser. On the other hand, Mongoose is detailed as "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.
LokiJS can be classified as a tool in the "In-Memory Databases" category, while Mongoose is grouped under "Object Document Mapper (ODM)".
LokiJS and Mongoose are both open source tools. Mongoose with 19K GitHub stars and 2.63K forks on GitHub appears to be more popular than LokiJS with 4.95K GitHub stars and 389 GitHub forks.
Pros of LokiJS
- Can query the objects directly3
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 LokiJS
Cons of Mongoose
- Model middleware/hooks are not user friendly3