0

Here i need to add couple of address for a user, while registration itself user will add one address, after that if user willing to another address he can.

Now i need to know how to add another address in mongoose subdocument array using angularjs and nodejs

this is my exsiting json for user

Json Image

How can i add another in address array

Nodemon
  • 1,036
  • 2
  • 25
  • 47

1 Answers1

0
db.collection.update({"email" : "ealai@excrin.com"},{
    $push : { 
                "address" : {
                    "flat_no"   : "102",
                    "street"    : "New My Street Details",
                    "city"      : "My City",
                    "_id"       : "My Id"
                } 
            }
})

This command help u to update yr existing user address @kalai

abenrob
  • 878
  • 10
  • 23
Ashesh Khatri
  • 162
  • 2
  • 11