Answer the question
In order to leave comments, you need to log in
How to partially modify an object in MongoDB?
Hello. I am using node-mongodb-native.
After the following code, all fields are completely erased from the selected object and only time: "20:00" remains
let users = db.collection('users');
users.update({telegramId:4}, {time:'20:00'}, function(err) {
if (err) throw err;
});
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