Wednesday, 12 April 2017

Baucis mongo $push to array

Is there a way to push to array using baucis? I want to push to an array another object.

"data" : [ 
    {
        "name" : "value",
        "_id" : ObjectId("58ee22032b4d566436edcfd9")
    }
]

I could do PUT to my server: server?populate

{'data.1': {obj}}

This will put a new object at the end but how can I push to the end of an array without specifying index?



via Yan

No comments:

Post a Comment