Answer the question
In order to leave comments, you need to log in
Why doesn't MongoDB save documents on Windows?
Hello.
Given the following:
Windows x64, installed and running MongoDB with the following line: D:\MongoDB\bin\mongod.exe --dbpath d:\MongoDB\data
In my Node.js application, I save the user to the 'users' collection:
MongoSave..
{ login: 'user17',
_id: 53233ca94be60a981d86b474,
settings: 'default_settings' }
POST /sign_up 200 38ms - 693b
Record added as { __v: 0,
login: 'user17',
_id: 53233ca94be60a981d86b474,
settings: 'default_settings' }
However, searching for documents returns an empty array:
UserModel
.find({})
.exec(function (err, users) {
if (err) return console.error(err);
console.log(users)
});
var collections = ['users', 'user_profiles'];
mongoose.connect('mongodb://localhost/test1', collections);
var db = mongoose.connection;
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