How to use Mongoose in Meteor?

I looked at the answer posted here: Meteor: Mongoose integration? but I'm looking for a simpler, more modular solution if possible for using Mongoose with Meteor.js.

Is there a better way I should handle ODM or inline support that I haven't seen?

+6
source share
2 answers

A meteor is already talking to a mongodb. But you can use mongoose. You may have a 10 second delay with reactivity. Also, you will not be able to use it on the client.

Meteor already has methods for requesting / updating, etc. mongodb. But if you want, you can force the mongoose to:

Install the mongoose (npm install mongoose). And use it in your meteor code:

require = __meteor_bootstrap__.require; //to use npm require must be exposed. var mongoose = require('mongoose'); 
+2
source

I decided to use the Collection2 package because it offers everything I wanted from Mongoose, like ORM. These packages use the Simple Schema as a dependency.

+12
source

All Articles