[Solved] inserting a new document in the arrray of documents


I don’t understand your document structure at all… and the only “user” array I could find in here was a field called “3”. Your code does in fact work and appends a document into the “3” array. The below is the result after running your code. Perhaps you could be more clear as to what you want your document to look like after you have “appended” a user.

{
  "_id":ObjectId("4fa7d965ce48f3216c52c6c7"),
  "name":"himani",
  "3":[
    {
      "1":"heena",
      "2":"divya",
      "values":[ 2, 5 ]
    },
    {
      "count":"2"
    }
  ]
}

1

solved inserting a new document in the arrray of documents