How to create primary/foreign key relationships in mongodb?
Answer / Anuj Baliyan
MongoDB does not support traditional primary and foreign key relationships as in relational databases. Instead, MongoDB uses a document-oriented approach where each document can contain its own unique _id field, and you can reference other documents by their _id value. To create a relationship between two collections, you would store the _id of the referenced document in the referring collection.
| Is This Answer Correct ? | 0 Yes | 0 No |
Is mongodb free to use?
What is bson and how can restore this file in mongodb?
When an object attribute is removed, is it deleted from the store?
In which format data is stored in mongodb?
What is mongoose in mongodb?
Can mongodb store structured data?
Is mongodb a nosql?
How do I show a collection in mongodb?
What is the command syntax that tells you whether you are on the master server or not? And how many master does mongodb allow?
Is mongodb worth learning 2019?
How you can inspect the source code of a function?
How do you know the all indexes available for a collection?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)