title: MongoDB insert object inside an object
body: <p>Please suggest me on how to insert an object inside an object.
  Sample collection</p>
  
  <pre><code>{
  "_id" : ObjectId("57556cec9d66a6c26b19ce06"),
  "email" : "david@gmail.com",
  "password" : "1235466",
  "typeOfUser" : 1,
  "userDetails" : {
      "firstName" : "David",
      "lastName" : "Beckham",
      "contactNumber" : "12345678989"
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I would like to add another object called address object inside this.
  something like this</p>
  
  <pre><code>{
  "_id" : ObjectId("57556cec9d66a6c26b19ce06"),
  "email" : "david@gmail.com",
  "password" : "1235466",
  "typeOfUser" : 1,
  "userDetails" : {
      "firstName" : "David",
      "lastName" : "Beckham",
      "contactNumber" : "12345678989"
       "address" : {
          "country" : "",
          "state" : ""
       }
    }
  </code></pre>
  
  <p>}</p>
  
  <p>Please suggest me on how to insert values for address object..</p>
  
  <p>What I have tried?</p>
  
  <p>db.getCollection('PetCare').update({"contactNumber":"12345678989"},{"$push":{"address":{"country":"India","city":"Blore"}}})</p>
  
  <p>but it does not update..</p>