Skip to main content
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
0 votes
0 answers
38 views

Index not getting applied while $lookup (Customers lookup in my query, _id index is not getting applied) for one of my query but for other query it’s getting applied. Below is the plan details which ...
user1952461's user avatar
0 votes
1 answer
119 views

I have 2 collections Customers and Orders. I have to filter the customers who have placed the order in the last 60 days. The aggregation that I have written to get this data is taking a lot much time. ...
tomas jindal's user avatar
0 votes
1 answer
47 views

I have 3 collections. I would like to create a view that would tell me if the image file of the image collection is used on another collection. Images "_id": "...
bernard's user avatar
0 votes
1 answer
540 views

I have two collections and I am using one of collections _id field as foreign key in other collection. But _id is Object and in in other collection it is string so $lookup is not able to match. ...
Alok's user avatar
  • 11k
0 votes
1 answer
112 views

I have a MongoDB aggregation pipeline, which I have written in C#. $geoNear{ near: { type: "Point", coordinates: [-110.29665, 31.535699], }, distanceField: "distance",...
Shehan V's user avatar
  • 164
1 vote
0 answers
69 views

I have a C# method that returns users' property data in a particular area using $geoNear and $project. I used the below pipeline to get the result. var pipeline = new[] { ...
Shehan V's user avatar
  • 164
0 votes
0 answers
100 views

Inside my existing pipeline, I wanna get a sample of 10 documents from another collection (another collection different than the one that the pipeline is targeted at). I could do this with $lookup, ...
Pedro Rabbi's user avatar
0 votes
1 answer
1k views

I have a two different collections, one for emailtemplates, and one for emails. And what I'm trying to do is write an aggregate pipeline that will show how many times each template has been sent using ...
J H's user avatar
  • 75
0 votes
1 answer
940 views

In the example below, if the collection inventory has an index on the sku field, will it be used in this $lookup operation? db.orders.insertMany( [ { "_id" : 1, "item" : "...
Bear Bile Farming is Torture's user avatar
0 votes
1 answer
525 views

I have two collections university and college. Under one university multiple colleges are there. I want to get the university and college detail according to below condition: 1.First get the ...
Sensei_75's user avatar
0 votes
1 answer
1k views

I have two collections that I want to join with $lookup based on two id fields. Both fields are from type guid and looke like this in mongodb compass: 'Binary('cavTZa/U2kqfHtf08sI+Fg==', 3)' This ...
M. Altmann's user avatar
1 vote
1 answer
34 views

In the following query, I want to fetch all verified students and their related meetings. but Trying to fetch all upcoming meetings which means meetings having at least one future date time. My ...
Mani's user avatar
  • 2,583
0 votes
1 answer
409 views

I have two collection present in mongodb database. one status column is common. I need matched and unmatched count from both the collection based on status column. I have written some code but it ...
Coder's user avatar
  • 364
0 votes
1 answer
3k views

I want to join two collections and find the documents where has one equal field and one unequal field! This is what I was tried, But not work db.collectionOne.aggregate[ { "$match&...
aidinMC's user avatar
  • 1,436

15 30 50 per page