I need to connect to the mongodb of my app from a non meteor app (node.js app)
Pleaseeeee help!
I need to connect to the mongodb of my app from a non meteor app (node.js app)
Pleaseeeee help!
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:3001/";
MongoClient.connect(url, function(err, db) {
if (err) throw err;
db.createCollection("customers", function(err, res) {
if (err) throw err;
console.log("Collection created!");
db.close();
});
});
logs db.createCollection() is not a Function… even db.collection(‘users’) logas the same