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.
2010-07-21 12:11:40
A:
If you want an index, create one. If you want a "PRIMARY KEY" you probably don't understand the concept of NoSql.
msw
2010-07-21 12:27:35