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?

Was it helpful?

Solution

It is enabled automatically in Mongojs, if you specify a callback.

https://github.com/gett/mongojs/blob/master/index.js#L168

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top