MongoDB update single primitive in an array
I needed to run a quick and (I thought) trivial query to update some incorrect data. I’m trying to update the very first entry of an array in a document.
Mongo query: find document where each embeded element equals to given value
I have a collection with embedded array of objects. I need a query to select only those documents where each of embedded objects
prop equals to some value:
MongoDB – Query Targeting: Scanned Objects / Returned has exceeded 1000
I’m receiving this MongoDB alert: Query Targeting: Scanned Objects / Returned has exceeded 1000.
MongoDB find multiple latest by filter criteria
Imagine the following sample data:
How to filter the result of group aggregation in MongoDB?
Here is a collection in MongoDB that contains documents with the following structure:
MongoDB wildcard in nested field selector
I have the following types in typescript.
Sorting MongoDb Aggregations with Multiple Fields
The answer from here seems like the same thing, but I’ve tried applying this and it’s not doing what I’d hoped, so clearly I’m doing something wrong.
MongoDB Slow Query issue
I am facing slow query issue in my mongoDB database, the indexing is done properly, I have checked that there is no duplicate numeric id, even though I am getting a slow query issue. The query I am using is findOne in which it is scanning the entire data base and returning one document only. It is also reporting that in this operation it cannot able to use the index and the operation execution time is around 40-50 ms which is resulting is slow query issue. What could be done to avoid this scenario.
How to $match $gte one field by another in mongo
I have mongo documents with this fields: