9

I noticed you guys are planning on adding more ORM features into your platform, but in the meantime, is there an easy way to extend your Collections with Mongoose Collections?

Mike Causer
  • 8,196
  • 2
  • 43
  • 63
parkej3
  • 111
  • 4

2 Answers2

4

You should be able to add:

npm install mongoose

To "admin/generate-dev-bundle.sh"

You can then create a new package and require mongoose, within that you can assign the method to: Meteor.mongoose too and connect to the MONGO_URL (This is Meteors database) for this command. Take a look round the other packages if you need some help.

I did the sample work in this branch: https://github.com/jonathanKingston/meteor/tree/mongoose

This is 100% untested as I'm on a windows machine at the moment but it should open up: Meteor.mongoose and just normal mongoose for the standard use as explained here but already connected: https://github.com/LearnBoost/mongoose#readme

jonathanKingston
  • 1,418
  • 10
  • 16
0

an issue with mongoose is that it won't work on the client. So you'll lose much of the benefit of using Meteor.

Take a look at Collections2 it offers validation and structure.

Good luck!

Michael Cole
  • 15,473
  • 7
  • 79
  • 96