skip to Main Content

Mongodb find different values from arrays

I'm using MongoDb version 5.0.6. I have this structure: { "_id": ObjectId("60c7180d5ef87b4de490c56d"), "data": { "user": [ {"country": "Netherlands", "originalCountry": "Denmark"}, {"country": "France", "originalCountry": "Denmark"}, ] }, "_id": ObjectId("60c7180d5ef87b4de490c56d"), "data": { "user": [ {"country": "ITALIE", "originalCountry": "ITALIE"}, {"country": "France", "originalCountry": "France"},…

VIEW QUESTION

Need to optimize mongodb query

I have a mongodb query and already created all required indices. But query still scanning all the documents in the collection. Following is the query: [ { "$group": { "driverStatuses": { "$addToSet": "$driverStatus" }, "batchAddedAt": { "$first": "$batchAddedAt" }, "cityId":…

VIEW QUESTION
Back To Top
Search