tags:

views:

105

answers:

2

I want to set one of my field as primary key. I am using mongodb as my nosql.

+5  A: 

_id field is reserved for primary key in mongodb, and that should be an unique value. If you don't set anything to _id it will automatically fill it with "MongoDB Id Object". But you can put any unique info into that field.

Additional info: http://www.mongodb.org/display/DOCS/BSON

Hope it helps, Sinan.

Sinan Y.
A: 

If you want an index, create one. If you want a "PRIMARY KEY" you probably don't understand the concept of NoSql.

msw