database - Updating a particular array element in nedb -
in nedb, have array field in document. how update array element @ index?
for example,
{ fruits:['mango','apple','banana'] }
i modify 2nd element , make array ['mango','pear','banana']
.
how using db.update
?
you can this:
db.update({_id:idtoupdate}, { $set:{'fruits[1]':'pear'} }, {}, callback);
Comments
Post a Comment