I'm using nodejs and the native mongo driver to update document in my collection. I can't query for the _id in my update statement.
db.users.update({
_id: user._id
}, {
$set: {
userName: user.userName,
email: user.email,
icon: user.icon,
role: user.role
}
}, {
multi: false
}, next);
what is the right way of doing it?