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"));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.