Search code examples
mongodbormmongoosemeteorodm

How to use Mongoose in Meteor?


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

Is there a better way that I should be handling ODM or native support I haven't seen?


Solution

  • Meteor already talks to mongodb. But you can use mongoose. You might have an issue with a 10 second delay with reactivity. Also you won't be able to enjoy using it on the client.

    Meteor already has methods to query/update,etc mongodb. But if want you could force mongoose in:

    Install 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');