Answer the question
In order to leave comments, you need to log in
Why doesn't db.createCollection('new-test') create a collection from node.js script?
I try to work with mongoDB without mongoose, I connect and try to create a collection, there are no errors, but when I enter the database from the console, there is no collection. What is the problem?
My code:
MongoClient.connect(DB_URL, function(err, db) {
assert.equal(null, err);
db.createCollection('new-test');
db.close();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question