the document model I'm using is as follows.
{
"_id" : "a301c595-f6f3-4ede-91c5-f1cabd548338",
"UserName" : "3@3.com",
"Revision" : 6,
"UserVocabs" : [
{
"Vocab" : "apple",
"LearnStatus" : 0,
"lastChanged" : 213232
},
{
"Vocab" : "book",
"LearnStatus" : 0,
"lastChanged" : 213132
},
]
}
I'm trying to add or replace objects in the UserVocabs array by their Vocab field so I don't know their indexes. till now the only solution I used is to first pull the object and then trying to push its updated version back in the array. but it needs 2 query for each object updates. is there any better solution out there?