soubhagya
soubhagya

Reputation: 806

How to update mongodb collection if there is no primary key

I have one collection and in that collection there is no primary key id but there is _id. how can i add one more field to the collection as primary key id

Upvotes: 1

Views: 472

Answers (1)

smonkey
smonkey

Reputation: 193

_id is the primary in mongodb. See also Difference between “id” and “_id” fields in MongoDB

Upvotes: 1

Related Questions