Closed xaiki closed 11 years ago
Awesome! Couple things:
Server
object to be passed in (don't necessarily want to be creating multiple connections to Mongo for each collection/backend)I'm not sure I can pass server,
Error: A Server or ReplSet instance cannot be shared across multiple Db instances
at new Db (/home/xaiki/src/TV/mbc-playout/node_modules/mongodb/lib/mongodb/db.js:72:11)
at Object.
My mistake...I meant the Db
object.
ok, implemented.
Looking at this closer I think there are too many cases to handle for it to make sense to include this. What about auth? If the user passes in a connection URL then we need to create the server and db objects ourself. Is the Mongo module installed? etc.
Take a look at https://github.com/kissjs/node-mongoskin or https://github.com/gett/mongojs. Including a middleware for those libs might make a little more sense since they provide a more straightforward API.
Yeah, sorry i forgot no update about this.
It's not really working, as when you do a collection call it stays in the db On Dec 9, 2012 3:03 PM, "Scott Nelson" notifications@github.com wrote:
Looking at this closer I think there are too many cases to handle for it to make sense to include this. What about auth? If the user passes in a connection URL then we need to create the server and db objects ourself. Is the Mongo module installed? etc.
Take a look at https://github.com/kissjs/node-mongoskin or https://github.com/gett/mongojs. Including a middleware for those libs might make a little more sense since they provide a more straightforward API.
— Reply to this email directly or view it on GitHubhttps://github.com/scttnlsn/backbone.io/pull/29#issuecomment-11173579.
I have mutating documents that I store in classes that inherits, so having to specify a Mongoose model is a bit too much for my needs. hence I've written this simple MongoDB middleware, so that I can do:
var mediabackend = backboneio.createBackend(); mediabackend.use(backboneio.middleware.mongoStore('mediadb', 'medias'));
and have everything automagically sync'd.