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 |
What will be objects between two dates in mongodb?
What are documents in mongodb?
What is a table in mongodb?
Which commands you use to lock the database in mongodb?
How to create index after every query insert?
What types of locking use in mongodb?
Does mongodb need a lot of ram?
Does mongodb use hadoop?
How does sharding work with replication?
What is the term match in mongodb?
In which language mongodb is written?
Is mongodb scalable?
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)