meteor - Some MongoDB questions -


i'm new mongodb , meteor. have checked official docs seems didn't job. here have couple of questions.

the structure follows.

{     _id:"127467812649871246",     "name":"disha",     "last_name":"shukla",     "members":      [         {            name:"xyz"         },        {            name:"abc"        }      ],      "user":"premium"  } 

1] how insert data in particular field when data exists referring record id ? in case, insert new member in "members"

2] in cases there wont "user":"premium" field. because wont insert @ first time. how check if field exists if have inserted document ?

any appreciated :)

thank you!

the $push command used insert data existing array in mongodb. , $exists used check whether field exists in collection. go links find more.


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 -

unity3d - Fatal error- Monodevelop-Unity failed to start -