node. Mongodb running on windows using Js code connection code snippet:
var mongo = expected ("mongodb"); Var host = "127.0.0.1"; Var port = mongo.Connection.DEFAULT_PORT; Var db = new mongo.db ("nodestest", new mongo.sure (host, port, {}); Db.open (function (error) {console.log ("connect" + host + ":" + port);}); The related error is: c: \ nodetest \ mongo.js: 5 var db = new mongo.db ("nodeet", new moongo. Server (host, port, {}); ^ Type Error: There is no function on object. & Lt; Anonymous & gt; (C: \ nodetest \ mongo.js: 5: 10) at Module._compile (module.js: 449: 26) at Object.Module._extensions..js (module.js: 467: 10) on Module.load ( Module.JS: 356: 32) on the module.Module_load (module.js: 312: 12) module.Renman (module .js: 492: 10) in process. Startup.prosensquestack.pros._tickcrollback (node.js: 244: 9) c: \ nodetest & gt; Any code that works well on Ubuntu? Thanksgiving robertklep problem was with "DB" but "DB" works well with Ubuntu
/ P>
No comments:
Post a Comment