One to many relation in mongo database

preview_player
Показать описание
Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.

All the learning resources such as code files, documentations, articles and community discussions are available on our website:

You can find our discord link, github link etc on the above website.

Рекомендации по теме
Комментарии
Автор

This video is really helpful but I still didn't understood how to link documents or how to link collections if you can clarify with more videos

anshikgupta
Автор

By using db.dropDatabase() command we would be able to delete one database at a time. So to delete multiply database we can use loop function like forEach() and loop all the database and delete them.
The code:-

{

if (['admin', 'config', 'local'].indexOf(x) < 0)
{

}
})

rameshsuthar
Автор

show dbs
use oldStudents
db.dropDatabse()

dharmendraprasad
Автор

One question sir.
What about when we need to add one more comment after inserting
record? I mean to say what about when we need to update this db for add one new comment

Code-Patel
Автор

You inserted a comment with reply, in comments collection, but didn't associate the reply, in replies collection, to your comment. The inserted document in replies collection was useless.

paolourielenriquez
Автор

To delete courses db:
1. use courses
2. db.dropDatabase()

amanmanojpreeti
Автор

How can we query the latest top 10 replies of that particular comment?

kartikgupta
Автор

00:00= One to One, 00:50= OneToMany example, 02:05= Drop databases,

narutodihargo
Автор

Hello. And how would be done if the id is auto generated by the Atlas MongoDB and is not known?

helloWorldPlus
Автор

how we can retrieve the data, if we have 2 database say 1db and 2db, in 1db we have 'user' collection which include some personal data like firstName, lastName, rollNumber in that we have some duplicate rollNumber user are persent and in db 2 we have 'trip' collection, where we have rollNumber, dateOfTravel, etc..which were created by respective rollNumber now how we can fetch the data which is having duplicate user detail from db 1 and respective trip also.

mritunjaisharma
Автор

how do i add more elements to that array?

danielalfonsogarcia
Автор

Well the second method is pretty good but i am thinking about memory of mongodb document. i guess it provides you 16mb size and i am sure that by using second method your memory will fill up very quickly.

Note: i am not mongodb expert i am also beginner but i read that on mongodb docs.

code_react
Автор

what happen when someone edit that reply?

ArifAli-hlxk
Автор

I wanted to know how to add a reply later when a comment has been inserted. and then how to fetch replies and their backwards how to know this reply belongs to which comment

NewtonIsLive
Автор

If replies gets nested, how to design the database?. please reply.

charans
Автор

> show dbs
- list of Databases
> use <DB name>
> db.dropDatabase()

usamajaved
Автор

why did you create new collection called replies. some time we got replies of replies multiple correct . but you can use same comments table and just refer comments id only

villanprabu
Автор

Use the delete delete('delete key':'delete data', ()=>{using callback})

gaganchoudhary
Автор

A better approach could have been to use the id of the comment inside the reply object. This will not require addition of ids to comment each time while adding a new reply

wassaufkhalid
Автор

Sir, I am working on a webapp where app require a company signup, i want to create a separate db for each company. i am using mongoose for mongodb .. since mongodb doesn't support query to create Database. So what should i do so that i can create my DB dynamically in a node js application
Please help me ..as i am new in this field

kamranjaved