How to enable Mongojs Safe Option?
Question
Consider the following nodejs code:
db = require('mongojs')('database', ['users, sessions']);
db.users.insert(
{
'email': email,
'password': password,
'firstname': firstname,
'lastname': lastname
},
function(err) {
// will there ever be output?
});
In this case, is safe mode enabled for mongodb to output error? If not, how do I enable it?
Solution
It is enabled automatically in Mongojs, if you specify a callback.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow