Reputation: 806
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
Reputation: 193
_id
is the primary in mongodb. See also Difference between “id” and “_id” fields in MongoDB
Upvotes: 1