What is a primary key in MongoDB?

Entry MongoDB

Answer

Every document has a unique _id field, which acts as the primary key. MongoDB generates an ObjectId if not provided.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice