One to many relation in mongo database

  Рет қаралды 63,225

Hitesh Choudhary

Hitesh Choudhary

Күн бұрын

Пікірлер: 74
@rameshsuthar4341
@rameshsuthar4341 5 жыл бұрын
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:- Mongo().getDBNames().forEach(function(x) { if (['admin', 'config', 'local'].indexOf(x) < 0) { Mongo().getDB(x).dropDatabase(); } })
@anshikgupta2993
@anshikgupta2993 5 жыл бұрын
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
@piyushtakale4648
@piyushtakale4648 4 жыл бұрын
someone please help me i have date stored in my mongodb database in ISO format i want to find documents using date in java i searched everywhere i havent found it. the problem is i have to store the date in the same iso format and search using date object only. and the date objects stores the date in like ... Thu Aug 20 00:00:00 IST 2020.... that is why its not working someone please help me
@Code-Patel
@Code-Patel 5 жыл бұрын
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
@paolourielenriquez9715
@paolourielenriquez9715 5 жыл бұрын
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.
@hikari00xx
@hikari00xx 4 жыл бұрын
11:10 then what is this? an embedded or a link?
@darshanraut554
@darshanraut554 3 жыл бұрын
Waste of time
@FeelFreeToCode
@FeelFreeToCode 5 жыл бұрын
Sir you are my motivator 👍😊😊😊😊
@narutodihargo
@narutodihargo Жыл бұрын
00:00= One to One, 00:50= OneToMany example, 02:05= Drop databases,
@helloWorldPlus
@helloWorldPlus 2 жыл бұрын
Hello. And how would be done if the id is auto generated by the Atlas MongoDB and is not known?
@dharmendraprasad198
@dharmendraprasad198 4 жыл бұрын
show dbs use oldStudents db.dropDatabse()
@mritunjaisharma1242
@mritunjaisharma1242 4 жыл бұрын
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.
@amanmanojpreeti
@amanmanojpreeti 3 жыл бұрын
To delete courses db: 1. use courses 2. db.dropDatabase()
@kartikgupta3756
@kartikgupta3756 4 жыл бұрын
How can we query the latest top 10 replies of that particular comment?
@NewtonIsLive
@NewtonIsLive 5 жыл бұрын
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
@charans1845
@charans1845 3 жыл бұрын
If replies gets nested, how to design the database?. please reply.
@villanprabu7539
@villanprabu7539 4 жыл бұрын
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
@danielalfonsogarcia7565
@danielalfonsogarcia7565 5 жыл бұрын
how do i add more elements to that array?
@dwezyow9146
@dwezyow9146 4 жыл бұрын
this is what i expected from the video, ops but theres nothing.
@ashishchhikara7829
@ashishchhikara7829 3 жыл бұрын
use array.push(element)
@viveks-yt
@viveks-yt 4 жыл бұрын
What's wrong in referring the document?
@johnnydriesen7575
@johnnydriesen7575 5 жыл бұрын
Supposing the next vid is going to be ... ManyToMany Relations ... Can't wait for it ... Since months, I'm struggling with situations like ... e.g. A Product has many Suppliers A Supplier delivers many Products A Product has a different price per Supplier ... Can't wait for a good solution :)
@nadim.a4351
@nadim.a4351 4 жыл бұрын
I'm sorry, months? you could just check the mongodb website. It's true that it's easier to just watch a video, but if I had no other option I would check the official website documentation instead of just waiting for a video.
@pradeepadmingradalpharecord
@pradeepadmingradalpharecord 4 жыл бұрын
Just an excercise to test my knowledge db.product.insertOne({name: "Product1", suppliers: [{supplier_id: "123", price: 321}, {supplier_id: "134", price: 341}]}); db.supplier.insertMany([{_id: "123", name: "Supplier1"}, {_id: "134", name: "Supplier2"}])
@temitopeagboolanuel
@temitopeagboolanuel 4 жыл бұрын
I'm also presently struggling with Mongoose populate which does the same thing. I've tried many methods, none is working; I've been literally frustrated by this.
@vipinkrishna6536
@vipinkrishna6536 5 жыл бұрын
use hiteshDB db.dropDatabase()
@kamranjaved5583
@kamranjaved5583 5 жыл бұрын
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
@wassaufkhalid8593
@wassaufkhalid8593 2 жыл бұрын
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
@sajed8077
@sajed8077 5 жыл бұрын
Love from Kashmir sir
@tejasmahajan4040
@tejasmahajan4040 5 жыл бұрын
Hi Hitesh, I have come across a scenario I have Hashmap in document Map, and I want to find document on basis of string which is present in List of value in map, is it possible can you please help me?
@ArifAli-hl2xk
@ArifAli-hl2xk 3 жыл бұрын
what happen when someone edit that reply?
@code_react
@code_react 5 жыл бұрын
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.
@gaganchoudhary6114
@gaganchoudhary6114 5 жыл бұрын
Use the delete delete('delete key':'delete data',()=>{using callback})
@Script_Sage
@Script_Sage 4 жыл бұрын
Embedded or Referenced.
@aninditadas7348
@aninditadas7348 3 жыл бұрын
Hello,Thanks for the video. But how can we edit a single reply, if we approach the second one?
@angulardesign7412
@angulardesign7412 3 жыл бұрын
plz make on nodejs sequalize relationships hasmany like
@omarhegazi1613
@omarhegazi1613 5 жыл бұрын
these are a normal crud operations that has nothing to do with relations in mongodb , please understand the subject first before recording a video
@dharsan.s7937
@dharsan.s7937 5 жыл бұрын
Hi tech my bro / teacher I love u brooooo
@prakharsingh4531
@prakharsingh4531 2 жыл бұрын
db.dropDatabase() command used to delete existing database
@masifqadri12
@masifqadri12 3 жыл бұрын
Sorry Boss Not Agree with the current example in replies, table add _id column with reply/replies
@FeelFreeToCode
@FeelFreeToCode 5 жыл бұрын
Great 💐👌👌👌👌
@SamareshMaity231
@SamareshMaity231 4 жыл бұрын
thank you
@vishaltalukar6676
@vishaltalukar6676 5 жыл бұрын
Can to make videos on data science using python for free?
@krushna7467
@krushna7467 3 жыл бұрын
db.name.drop() ?
@mr_don_key
@mr_don_key 5 жыл бұрын
very odd that you can explain relationships in mongo.. but are not able to remove collections.. :)
@praveenrangasubhe9374
@praveenrangasubhe9374 2 жыл бұрын
db.collectionname.drop()
@taherlunavadi2559
@taherlunavadi2559 5 жыл бұрын
use youtube db.dropDatabase()
@techspider2528
@techspider2528 4 жыл бұрын
use exampledb db.dropDatabase()
@teklezegergish
@teklezegergish 4 жыл бұрын
Use drop to delete from mongo DB
@fincept-tilak2172
@fincept-tilak2172 5 жыл бұрын
Data science
@cristianyamidperezgranda2949
@cristianyamidperezgranda2949 4 жыл бұрын
Thanks, ¿what's is the best way to get all replies from all comments?, is convenient create other collection to duplicate all replies?, thank you, nice video
@disasterunfold7885
@disasterunfold7885 4 жыл бұрын
db.dropDatabase() as simple as that
@jijinp1612
@jijinp1612 5 жыл бұрын
mongo youtube --eval "db.dropDatabase()"
@pavanagarwal6753
@pavanagarwal6753 4 жыл бұрын
can i edit my comment? Answer is "yes"
@Srinath666
@Srinath666 Жыл бұрын
use and after that db.dropDatabase() to delete
@muramullasiri5087
@muramullasiri5087 4 жыл бұрын
db.dropDatabase()
@sweetdevil3647
@sweetdevil3647 4 жыл бұрын
db.COLLECTION_NAME.drop() !!!
@vishaltalukar6676
@vishaltalukar6676 5 жыл бұрын
First
@akhilakhil9325
@akhilakhil9325 4 жыл бұрын
poor
@NewtonIsLive
@NewtonIsLive 5 жыл бұрын
you wasted my time , waste of time
@NewtonIsLive
@NewtonIsLive 5 жыл бұрын
you wasted my time..
@usamajaved3509
@usamajaved3509 2 жыл бұрын
> show dbs - list of Databases > use > db.dropDatabase()
@omkanade5
@omkanade5 3 жыл бұрын
show dbs use oldStudents db.dropDatabse()
Many to Many relation in mongoDB
10:18
Hitesh Choudhary
Рет қаралды 38 М.
One to one relation in mongo database with id
9:37
Hitesh Choudhary
Рет қаралды 42 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
One to one relation part 2
7:08
Hitesh Choudhary
Рет қаралды 9 М.
Save bandwidth while querying in mongoDB
11:28
Hitesh Choudhary
Рет қаралды 17 М.
MongoDB Schema Design Best Practices
9:58
MongoDB
Рет қаралды 169 М.
MongoDB Schema Design Best Practices
50:39
Joe Karlsson
Рет қаралды 175 М.
UpdateOne and DeleteOne in #mongoDB
10:39
Hitesh Choudhary
Рет қаралды 27 М.
MongoDB | One-To-One, One-To-Many, Many-To-Many
16:39
Teddy Smith
Рет қаралды 4,5 М.
Relation in database mongoDB
6:04
Hitesh Choudhary
Рет қаралды 52 М.
MongoDB Tutorial - Modeling with MongoDB
10:16
Fullstack Academy
Рет қаралды 81 М.
AM Coder - MongooseJS Course #4 - Mongoose Relationships (ObjectID and Populate)
15:36
Web Development with Alex Merced
Рет қаралды 9 М.