Linked Questions
143 questions linked to/from How do I perform the SQL Join equivalent in MongoDB?
171
votes
7
answers
157k
views
MongoDB and "joins" [duplicate]
I'm sure MongoDB doesn't officially support "joins". What does this mean?
Does this mean "We cannot connect two collections(tables) together."?
I think if we put the value for _id in collection A to ...
TK.'s user avatar
- 28.4k
5
votes
1
answer
28k
views
How to do Left Join in DB (Mongo) [duplicate]
I am new to Mongo! Please help me how to do left join in Mongo
Sql Statement :
Select * from TableA left Join TableB
on (TableA.col1 = TableB.col1 AND TableB.col2 = "ABC")
Please provide me the ...
0
votes
1
answer
5k
views
How to join two tables in mongoDB with aggregation and need to get result based on match [duplicate]
I want to join two tables in mongoDB. I have
table-1) location
"_id" : ObjectId("5c0f5d16e32f1fe49e648ac8"),
"device_time" : "2018-11-30 10:48:44",
"l_created_date" : "2018-11-30 10:49:18"...
2
votes
1
answer
3k
views
MongoDb - "Join" Collections [duplicate]
Given the following collections:
Message collection
{
"_id" : ObjectId("59f76fc3a8e87e411c22d0ac"),
"OriginApp" : "App1",
"MsgGroupId" : "499",
"UserName" : "User1",
"Message"...
-2
votes
1
answer
1k
views
Mongoose + NodeJS - Looping through documents? [duplicate]
I have two collection - Call them main and sub. My main collection looks like below,
{
"_id" : "xxxxx",
"subId" : "1234"
}
And my sub looks something like,
{
"_id" : "1234",
"name" : "...
1
vote
2
answers
1k
views
Creating relationship between collection in Pymongo and rendering it Jinja [duplicate]
Consider the below image. I have two collection in MongoDB and I want to render the result where just by matching the name it should give me the desired output.
My problem is I am unable to ...
2
votes
1
answer
811
views
How to map two collections in mongodb using node js [duplicate]
I have doubt how to map two collection in mongodb using mongoclient.I tried it but its not working.how to solve it
group_promotion collection
{
"_id" : ObjectId("5cf7679a0b0bed2e7483b998"),
...
0
votes
0
answers
711
views
Mongodb copy field to another array field type [duplicate]
I want to create a migration script that able to copy from Project assignedTo field to Project assignedMultiple but inserted in an array with the users detail on it and assignedTo field will be null. ...
0
votes
3
answers
415
views
how can i write this query with mongodb? [duplicate]
I want to write this query with mongodb
select *
from tab1 a, tab2 c
where a.a_id = 2
and c.c_id = 3
and a.a_id = c.c_fk_account_id_created_by
I tried this code but didn't get ...
0
votes
0
answers
425
views
How to process each record in a large collection (~>500MB) [duplicate]
I have several large collections in a mongo db. some with sizes ~500 MB.
(Collections get bigger over time reaching the 500MB in size and bigger)
Collection1:
109091 documents
...
1
vote
1
answer
407
views
Want to join two collections and result should be filter from both collections [duplicate]
{
"_id" : ObjectId("5e8dae610b209222e10a0ac4"),
"serial" : "2248",
"externalId" : "452085",
"hierarchyPathByIds" : ",5e2eb1662698a2097c71d855,",
"status" : "ACTIVE",
}
...
1
vote
0
answers
351
views
mongo db how to use cursor function to find a condition with if statement? [duplicate]
Hi guys I have created a cursor in mongo db to find a condition which is shown below
var mycursor = db.catalog.find({})
mycursor.forEach(function(x)
{if(x.book.find({"publisher":{"$exists":true ,...
0
votes
0
answers
295
views
use $populate in aggregation mongoose [duplicate]
I don't know when to use ref in schema, but recently I started to use it as it looks clean. Below is a working example.
const UserSchema = new Schema({
credit: {
type: Schema.Types.ObjectId,
...
0
votes
0
answers
235
views
C# MongoDB - How to "join" and get a value from other collection? [duplicate]
I've got the following collections:
Table1 = { _id, Title }
Table2 = { _id, Name }
Table3 = { _id, TableType, TableId }
I need to do a query to return a result that includes the Title or Name ...
0
votes
0
answers
223
views
CastError: Cast to ObjectId using populate [duplicate]
I have UserSchema and CreditSchema
const UserSchema = new Schema({
credit: {
type: Schema.Types.ObjectId,
ref: 'Credit'
}
})
const CreditSchema = new Schema({
userId: Schema.Types....