CosmosDB Mongo - What's the better way to check if an array is empty ?
Kais Khan Hadi
0
Reputation points
Hey I want to check if some of my arrays on a document are empty. Right now I'm doing a simple
{"myArray": []}
(eq operation), because I know that using the $size operator would prevent MongoDB to use any indexes (it would be like this :
{"myArray": {$size: 0}}
But since MongoDB and CosmosDB have some discrepancies (especially the indexes doesn't work the same), I wondered if this was really the case when using Cosmos ? I didn't find anything related in the documentation. Thanks for your help.
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,902 questions
Sign in to answer