I have a document that contains an array of arrays in my MongoDB collection. { "platformId":"CMC_123", "carInfo":[ ["Toyota",20,"White"],
After some of the aggregation pipeline stages, my MongoDB Document has the following format: { "key": "A", "status": "To Do", "val": 4 }, {
I need to execute a lookup stage on all documents inside an array. The collection: { { "name": "test", "age": 2, "replies": [ {
I have all combination of compound indexes for this collection. The aggregattion query i used is: db.products.aggregate( [ { $facet: { "categ
How do I delete all the chunks documents which are returned as a result of this aggregation? db.getCollection('chunks').aggregate([ { $lookup:
I have an aggregate on a collection with about 1.6M of registers. That consult is a simple example of other more complex, but illustrate the poor optimization o
Is it possible in MongoDB to somehow subtract only months from a date, with a value from the same document. So for example i have to subtract date from field "v
Let me give a example here: Two entries in the collection Author: { "name" : "Joe" "Book" : "A" }, { "name" : "Joe" "Book" : "B" } Now, if I use the aggrega
I have created a collection and added a unique key like this db.user_services.createIndex({"uid":1 , "sid": 1},{unique:true,dropDups: true}) The collection
Is there a way to calculate the median using the MongoDB aggregation framework?
I have mongo query which does the group operation on the documents. I have almost got the expected results except that I want to refine the results without emp
I am an absolute beginner when it comes to MongoDb. Just joined a new project where it is used, so I tried to do few experiments to get myself familiar. I got t
I write a big aggregate query for mongodb, now I try to translate it in Spring Data Mongodb API, and it's very complicated, and spring data api did not help me
How would I find duplicate fields in a mongo collection. I'd like to check if any of the "name" fields are duplicates. { "name" : "ksqn291", "__v" : 0
I have a collection which contains documents with multiple arrays. These are generally quite large, but for purposes of explaining you can consider the followin
I have two collections with same structure and want to merge them in aggregation result and query & sort over them after merging. E.g.; First collection: