简体   繁体   中英

NodeJs MongoDB -Having TypeError while updating every document on one field in a collection

 var MongoClient = require('mongodb').MongoClient; MongoClient.connect("mongodb://blablabla:abcdefgh@ds123321.mlab.com:21212/aslanservices", function(err, db) { if(err) { return console.dir(err); } db.collection('sakins').insert({adsoyad : 'amg amg amg', apartman : 'ferhatapt', daireno : '3', borc : '100' }); db.collection('sakins').insert({adsoyad : 'cla cal cla', apartman : 'aslanapt', daireno : '4', borc : '75' }); db.collection('sakins').insert({adsoyad : 'bla bla bla', apartman : 'ferhatapt', daireno : '5', borc : '150' }); db.collection('sakins').uptade({'borc' : 'borc' + 75 },function(err,result){ console.log(result); }); db.close(); });//End of Mongoclient connection 

I can succesfully performing operations such as inserting,finding documents but i cannot uptade and i am having the error below : throw error Type Error : db.collection(...).uptade is not a function

Can you help me about uptading particular field in every document in the collection named 'sakins' ?

You've misspelled update. Its update not uptade.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM