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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -