findOneAndUpdate

But but. I returned to the original post and original query. And it also works wonderfully. Yes the following

So I felt in the same trap I felt before, that is, assuming that there was a real problem other than typos in field names and/or missing $ in some field names. In the first post, package.maxUserCount was missing the $ but that was corrected promptly. I should also have requested sample documents. Perhaps the discrepancy is between the field name

or the text requirement

I tried different typos variations and the one that

is the one where the $ sign is missing in front of package.maxUserCount. When the dollar sign is present with a non existing field name the query is false for all documents.

2 Likes