1
vote
1answer
556 views

How to increment object fields inside an array using MongoDB?

Initially this is the format of my document: { _id: some id, name: 'some name', versions: [] } In the versions field I store objects like {v: '2.5', count: 5} where count holds the ...
1
vote
1answer
601 views

How to update nth element inside an array without $pull or $pop?

How to update value of the nth position element inside an array? I want to update index 2 of category_id. One solution is ($pop or $pull) and $addToSet. Is there any other solution? Array ( [_id] ...
0
votes
1answer
186 views

parent child relationship query mistake in MongoDB in Action book

I am suspecting the method defined to get siblings in the book MongoDB in Action Every category keeps parent_id that is the parent category id. So sibling categories should have common parent_id. ...