Skip to main content
Best practices
0 votes
1 replies
54 views

Trying to solve a conundrum I have in writing some queries. I’ve traditionally used simple find operations (and cursor operations for paging functionalities), but need something more complex to ...
Snappawapa's user avatar
  • 2,082
0 votes
1 answer
115 views

I have been experiencing slow mongo queries suddenly. The execution times varies very randomly. Initially I was suspecting this expensive aggregation operation :- { "appName": "XXXXXX&...
LEO_007's user avatar
  • 51
0 votes
1 answer
59 views

i tried to count stuff in group (by a filed location) but with a condition. So i got a group with multiple values: escalated and non-escalated. (and count for testing) The condition is a boolean field ...
A. Rabus's user avatar
  • 539
0 votes
1 answer
65 views

I'm encountering a very strange issue after switching a MongoDB aggregation pipeline from using $regex to a more efficient $text search. My application code is correct, but the server returns an error ...
Tsepo Nkalai's user avatar
  • 1,514
-2 votes
1 answer
95 views

I’m working with a MongoDB compound index like this: db.users.createIndex({ gender: 1, city: 1, age: 1 }) Suppose city has only a few possible values, e.g., "Chicago", "LA", "...
Bear Bile Farming is Torture's user avatar
-3 votes
1 answer
97 views

https://mongoplayground.net/p/2CHyeuaG0y0 db.test.aggregate([ { $match: { $or: [ { cheese: { "$exists": true } }, { ...
Bear Bile Farming is Torture's user avatar
0 votes
1 answer
91 views

I’m working with a collection where documents contain an array of subdocuments, for example: { "_id": 1, "tasks": [ { "priority": 2, "dueDate": "...
Bear Bile Farming is Torture's user avatar
-1 votes
1 answer
71 views

I have a users collection with a compound index: db.users.createIndex({ bin: 1, gender: 1, age: 1, location: 1, // ... other fields }); When I query like this: db.users.find({ bin: X, ...
Bear Bile Farming is Torture's user avatar
0 votes
1 answer
55 views

I am working with MongoDB and have a compound index on a collection, e.g., { a: 1, b: 1 }. I want to understand the performance implications when updating documents with respect to the fields in this ...
Bear Bile Farming is Torture's user avatar
-2 votes
1 answer
83 views

index: { "name": "tar", "key": { "tar.a": 1, "tar.b": 1 } tar is an array of subdocuments. query: ...
Bear Bile Farming is Torture's user avatar
-5 votes
1 answer
77 views

Given a aggregation pipeline like this, in which I use a $match with { $exists: false } on a indexed field: db.collection.aggregate([ { $match: { myField: { $exists: false } } } ]) ...
Bear Bile Farming is Torture's user avatar
1 vote
1 answer
82 views

Doctrine ODM allows to group a set of matched documents: https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/2.9/reference/aggregation-stage-reference.html#group Consider documents ...
David's user avatar
  • 2,883
0 votes
1 answer
60 views

How to group by and count value of field which is in list? I have documents looks like this: [ {"_id": "some_id","uuid": "unique_uuid", "my_field": [{&...
Zesshi's user avatar
  • 524
0 votes
0 answers
31 views

I'm using the Google Maps Distance Matrix API to calculate route-based distances (not straight-line distances). However, since third-party API calls cannot be made within a MongoDB aggregation ...
Zeeshan Abbasi's user avatar
1 vote
0 answers
26 views

I have two MongoDB collections: c1 and c2. c1 has properties: p1, p2 c2 has properties: p3, p4 c1._id is referenced by c2.customerId I need to: Perform a $lookup to join c1 with c2 Apply filters on ...
arrxy's user avatar
  • 11

15 30 50 per page
1
2 3 4 5
843