update mongodb adapter

This commit is contained in:
Nathan Cartwright 2012-11-08 14:54:36 -06:00
parent 3731447787
commit 596cd3d461
1 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,9 @@ exports.initialize = function initializeSchema(schema, callback) {
s.database = s.database || 'test'; s.database = s.database || 'test';
} }
s.safe = s.safe || false;
schema.adapter = new MongoDB(s, schema, callback); schema.adapter = new MongoDB(s, schema, callback);
}; };
@ -69,7 +72,7 @@ function MongoDB(s, schema, callback) {
server = new mongodb.Server(s.host, s.port, {}); server = new mongodb.Server(s.host, s.port, {});
} }
new mongodb.Db(s.database, server, {}).open(function (err, client) { new mongodb.Db(s.database, server, { safe: s.safe }).open(function (err, client) {
if (err) throw err; if (err) throw err;
if (s.username && s.password) { if (s.username && s.password) {
t = this; t = this;