0

I want to find an array nested in a document. The document structure is like this :

{
  name:himani;
  user:
  {
    Id: 1,
    Qualification: Programmer,
    PhoneNo: [2524785, 9983410902]
  }
}

Now I want to find PhoneNo and add a new number to it. I am using C# driver . Please tell me the way of doing it.

1 Answer 1

1

Let's say you want to add a new PhoneNo 9876543210 to the document with the name hinami:

peopleCollection.Update(Query.EQ("name", "himani"), Update.Push("user.PhoneNo", "9876543210"));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.