![](/img/trans.png)
[英]Why does jquery code not working on the server but works on my PC?
[英]node js mongodb callback not working - The below piece of code works on my Laptop but does not work on another PC
下面的一段代碼適用於我的筆記本電腦,但不適用於另一台 PC。 // 連接到mongodb
MongoClient.connect(url, function (err, db) {
if (err) {
winston.error('Unable to connect to the mongoDB server. Error:', err);
} else {
winston.info('Connection established to', url);
database = db;
var collection= database.collection('events_dashboard');
collection.findOne({
timestamp_day : deviceTimestamp ,
machineId : machine.id,
currentStatus : machine.currentState
}, function(err, doc){
winston.info('never came here');
if(doc == null){
insertRawEvent(machine,rawCollection);
updateEvent(machine,0);
}
});
}
那么你是先在你的 PC 上啟動 mongodb 的嗎? 哪個可能會在您的筆記本電腦中自動啟動?
在徹底比較了我的筆記本電腦和 PC 的規格后,我們發現 PC 上只有 windows 7 ,而不是 windows 7 service pack 1。安裝 SP1 后,它開始工作了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.