Using AngularJs and MongoDB/Mongoose Using AngularJs and MongoDB/Mongoose mongodb mongodb

Using AngularJs and MongoDB/Mongoose


You'll need an interim step there. Going directly from Angular to Mongo will not work out. If you want a generic REST interface to Mongo with which you can utilize Angular's bundled $http services, take a look at the list of REST services on Mongo's site.

Mongo REST Services

http://www.mongodb.org/display/DOCS/Http+Interface#HttpInterface-RESTInterfaces

Angular $http Service:

http://docs.angularjs.org/api/ng.$http

There's a lot of different options here, but this is likely the easiest way to get up and going.


The interim step has been provided by a npm module, angoose. It does exactly what you asked for: making the mongoose models available as Angular injectable factories. All you need to do is just including a script tag in your html file.

angoose module:

https://npmjs.org/package/angoose

Disclaimer: I'm the contributor of angoose module.