Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const updateDocument = function(db, callback) {
- // Koleksiyon, db objesinden alınır
- const collection = db.collection('employees');
- // İlk parametre ile güncellenecek kayıt bulunur, sonra istenilen field'ı güncellenir.
- collection.updateOne({ id: 1 }, { $set: { yas: 26 }},
- function(err, result) {
- if(err) throw err;
- console.log("1 Id'li kaydın yaşı güncellenmiştir.");
- callback(result);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement