17,493 questions
Best practices
0 votes
1 replies
52 views
Mongodb Using aggregates for advanced search
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 ...
0 votes
1 answer
53 views
Mongo unexpected mongo queries
i have some problems in production using mongo We have python using mongo and mongo-express for ui. And we are facing performance issues, after research i found db.currentOp() to see queries which are ...
-2 votes
1 answer
95 views
In MongoDB, is there a performance difference between $in covering all possible values vs leaving the field out in a compound index?
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", "...
0 votes
1 answer
85 views
All fields except _id disappeared from a MongoDB document after a $set operation
I'm using MongoDB Atlas 7.0 on a dedicated cluster and encountered a bizarre issue where a document in one of my collections mysteriously lost all its fields except for the _id. I performed a ...
-1 votes
1 answer
71 views
Can MongoDB use a compound index to sort when filtering with $in?
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, ...
2 votes
0 answers
136 views
MongoDB Atlas connection error: queryTxt ETIMEOUT with Mongoose
Mongoose connection to MongoDB Atlas fails with queryTxt ETIMEOUT I’m trying to connect my Node.js app to MongoDB Atlas using Mongoose, but the connection fails with a timeout error. Here’s the error ...
-5 votes
1 answer
77 views
Can MongoDB use an index for $exists: false on an indexed field? [closed]
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 } } } ]) ...
0 votes
1 answer
102 views
Using Mongodb Project() on ColdFusion
I want to do this in ColdFusion RecurringType = rc.db.RecurringType .find() .sort({ "SortOrder" : 1 }) .project({_id : 0}) .toArray(); However I get an error message of ...