Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何启用Mongojs安全选项?_Node.js_Mongodb_Mongojs - Fatal编程技术网

Node.js 如何启用Mongojs安全选项?

Node.js 如何启用Mongojs安全选项?,node.js,mongodb,mongojs,Node.js,Mongodb,Mongojs,考虑以下nodejs代码: db = require('mongojs')('database', ['users, sessions']); db.users.insert( { 'email': email, 'password': password, 'firstname': firstname, 'lastname': lastname }, function(err) { // will there ever be output? }); 在这种情况下

考虑以下nodejs代码:

db = require('mongojs')('database', ['users, sessions']);
db.users.insert(
{
  'email': email,
  'password': password,
  'firstname': firstname,
  'lastname': lastname
}, 
function(err) {
  // will there ever be output?     
});

在这种情况下,mongodb是否启用了安全模式以输出错误?如果没有,我如何启用它?

如果指定回调,它将在Mongojs中自动启用