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 |
Does mongodb have a schema?
What are indexes in mongodb?
Can mongodb used for cache management?
Is mongodb a firebase?
What is mongoose in mongodb?
Is mongodb easy to learn?
Who developed MongoDB and when?
Does mongodb cost money?
Can I remove old files in the move chunk directory in mongodb?
Is mongodb support null values?
Can mongodb store binary data?
In which format data is stored in mongodb?
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)