right now, i do this in command line:
var obj = db.mycollect.find({id="231412"});
obj.abc = 'new value';
obj.save();
3 lines of code..
is there a simpler way to do this?
e.g. db.mycollect.find({id=12345}).save({abc:'new value'});
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is not only one line but also atomic. With your solution if somebody updates the document after you’ve read it but before storing it that modification will be lost.