From 596cd3d461f62e01d2bab5104a54a2c795360639 Mon Sep 17 00:00:00 2001 From: Nathan Cartwright Date: Thu, 8 Nov 2012 14:54:36 -0600 Subject: [PATCH] update mongodb adapter --- lib/adapters/mongodb.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/adapters/mongodb.js b/lib/adapters/mongodb.js index 7f47d483..333ad71a 100644 --- a/lib/adapters/mongodb.js +++ b/lib/adapters/mongodb.js @@ -49,6 +49,9 @@ exports.initialize = function initializeSchema(schema, callback) { s.database = s.database || 'test'; } + + s.safe = s.safe || false; + schema.adapter = new MongoDB(s, schema, callback); }; @@ -69,7 +72,7 @@ function MongoDB(s, schema, callback) { 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 (s.username && s.password) { t = this;