Tôi cố gắng để chạy một kịch bản Node.js tại địa phương và nó đem lại cho tôi thông báo lỗi này:Node.js MongoDB thiết lập mặc định an toàn biến
======================================================================================== = Please ensure that you set the default safe variable to one of the = = allowed values of [true | false | {j:true} | {w:n, wtimeout:n} | {fsync:true}] = = the default value is false which means the driver receives does not = = return the information of the success/error of the insert/update/remove = = = = ex: new Db(new Server('localhost', 27017), {safe:false}) = = = = http://www.mongodb.org/display/DOCS/getLastError+Command = = = = The default of false will change to true in the near future = = = = This message will disappear when the default safe is set on the driver Db = ========================================================================================
Dưới đây là các biến của tôi:
var express = require('express');
var mongodb = require('mongodb');
var GridStore = require('mongodb').GridStore;
var Db = require('mongodb').Db;
var Server = require('mongodb').Server;
var db = new Db(Config.dbName, new Server("127.0.0.1", 27017, {}), {});
var HttpGet = require('./httpGet').HttpGet;
var URL = require('url');
var dbClient = null; // this is initialized when db is opened
var app = module.exports = express();
Các cùng một tập lệnh chạy tốt trên máy chủ trực tiếp của tôi. Nó chỉ complanes khi tôi chạy nó tại địa phương.
Tôi thấy vấn đề tương tự này đang được thảo luận về github nhưng không tìm thấy giải pháp nào. https://github.com/kissjs/node-mongoskin/issues/77
Bất kỳ ai biết điều gì có thể gây ra sự cố này?
Cảm ơn trước :)
Tôi đã cố gắng đó, Khi tôi làm điều này, tôi nhận được "Chạy LỖI: (Thu 11 tháng 10 năm 2012 15:36:44 GMT-0400 (EDT)): {}". Nó không cho tôi biết lỗi là gì. –
@FarhanAhmad Bạn có chạy nó dưới trình gỡ lỗi để xem dòng nào đang tạo ra lỗi đó không? – JohnnyHK
Điều tương tự. Nó bắt đầu lắng nghe trên cổng 5858 và sau đó cho thấy "Chạy LRI: (Thu Oct 11 2012 15:57:08 GMT-0400 (EDT)): {}" –