Unknown projection operator $size

I have two MongoDB instances, one is local, and other is for dev testing. Both have version 5.0.0

I send same query to both databases:


In local database i got expected answer with list of entries and it size.
But in dev database i got error “Query failed with error code 2 with name ‘’ and error message ‘Unknown projection operator $size’ on server”

Do mongoDB have some mechanism to fix wrong queries, and it fix it in first situation?
Or how it can be explained, that same query give error only in one situation?

Hey @Roman_Buzuk1,

Welcome to the MongoDB Community!

Could you share the sample documents, so we can troubleshoot the query in our environment to assist you better? Also, please share the specific sub-version of both the deployed servers.