Linked Questions

2 votes
0 answers
2k views

In MongoDB I have: Collection customers with embedded array orders: db.customers.insert([ {_id: 1, name: "John", orders: [ {articleId: 1, quantity: 10}, {articleId: 2, quantity: 5} ]}]); ...
Herman Fransen's user avatar
2 votes
0 answers
1k views

I'm developping an api with mongoose and nodejs. Basically there is a Course Model, Student Model and Group Model. For every course there is two fields in course document: . Field "students": array ...
Francisco Mora Sánchez's user avatar
0 votes
0 answers
182 views

Consider the below three collection in which I have grouped Collection 1 with Collection 2 using $lookup. I am able to get the preowned price for Adidas shoes but when a user selects PUMA shoes then ...
fear_matrix's user avatar
  • 5,000
0 votes
1 answer
123 views

I have a database structured like this: I want to get all listItems, of all lists from a user with a x ID. What's the correct way of doing that? I'm using node with mongoose, and I tried the ...
Jessica's user avatar
  • 9,880
1 vote
0 answers
133 views

Currently I have three Collection "User" , "UserLocation" & "UserAddress" which are related with each other. Below are the Schema UserModel var userTable = new Schema({ name: String, email ...
Shashikant Maurya's user avatar
1 vote
0 answers
47 views

So basically what I'm trying to achieve is to get tickets from a concert. every ticket has a seller ID which I want to join with the collection users. This is the query I have, to get all the tickets ...
julian-blaschke's user avatar
0 votes
0 answers
48 views

I would like to map back the valuse from a $lookup operation to local array field. Currently, I am only able to create a standalone array field using $lookup, but not able to map the value back ...
chakwok's user avatar
  • 1,040
0 votes
1 answer
48 views

While trying to use lookup in 2nd level, getting an empty array instead of an object. I have 3 collections, 1. registration 2. bus 3. operator Here, registration contains busId, and the ...
Shams Nahid's user avatar
  • 6,569
1 vote
0 answers
40 views

I have a user schema with the sub-schema called project and inside the project I have another schema called boq. How can I populate boqs and projects all in one page without using findById. I can ...
Sam's user avatar
  • 207
0 votes
0 answers
27 views

I have 3 collections in a MongoDB instance. I need to join the 3 collections using the lookup operation and I need the collections nested within their respective parent objects. For example, I have ...
Sunil Kumar's user avatar
1 vote
0 answers
29 views

db.getCollection('raw_attom_recorder').aggregate([ { $match: {"RecordingDate": { $gte: ISODate("2018-01-01T00:00:00.000+0000") }} } , { $sort : { AttomId : 1, ...
Manasa Tallam's user avatar
13 votes
1 answer
18k views

I am struggling with the newish (lovely) lookup operator in MongoDB. I have 3 collections: artists { "_id" : ObjectId("5b0d2b2c7ac4792df69a9942"), "name" : "Dream Theater", "...
vicusbass's user avatar
  • 1,814
2 votes
1 answer
5k views

I have two collections listed below :- table1 {"_id" : ObjectId("5b9a.."), "item_id" :"1.1", "m_date" : "20130401","ref_id":"12R","sub_item_id":"1.1.1"} {"_id" : ObjectId("5c37.."), "item_id" :"1.1",...
SRK's user avatar
  • 105
1 vote
2 answers
2k views

I've 3 Collections: School { "id" : { "$numberLong" : "100000" }, "name" : "School1" } Faculty { "id" : { "$numberLong" : "100000" }, "schoolId" : { "$numberLong" : "100000" },...
mewc's user avatar
  • 135
1 vote
2 answers
5k views

I am configuring Mongoose to work on an existing MongoDB, that has these two collections: Users - with fields: _id: ObjectId name: String org_id: ObjectId Organizations - with fields: _id: ObjectId ...
Alexander's user avatar
  • 7,884

15 30 50 per page