查询并不总是返回所有匹配的文档,这真的很奇怪,不是吗?您对此行为有任何想法吗?
预先感谢
mongoose.connect(config.mongoUrl);
mongoose.connection.on('error',function (err) {
console.log("Error: " + err);
});
User.find({"Role" : "User"}, function (err, users) {
if (err) { throw err; }
for (user in users){
user = users[user];
console.log(user.Role + " " + user.Email1);
}
}).then(function(doc) {
console.log("finish User Update");
process.exit();
});