Ok but $elemMatch will return the other array- players which may contain lots of entries.
Also how would i modify the particular array that i got from the $elemMatch query.
$elemMatch filters the document to just the array element when used as the projection argument . Sorry for the confusion.
Now the question is -
What is the efficient way to modify the array element and store it back in its respective position?
How to delete the array element from the document?
How to insert a new element in the array?
Sorry for lost of questions but i noob in this stuff.
Himanshu Jain
Eg. JSON
If i have to find a record for particular player in active players array
eg. player with name 'himan' in the activeplayers array. The activeplayer array grows as the no of player in city grows but every city has a limit of 50 concurrent players.
So how it is possible without updating the whole document or parsing through the whole document.
1 person has this question