Monday, 30 September 2013

_id field compared to index

_id field compared to index

I'm planning to add a Collection to a mongodb database that will have a
text field that should be unique for each Document. Lookups from this
Collection will almost always be based on this field. This field can
contain as many as 100+ chars.
My question is, should this field be the _id field, or should I just add
an index for it? What would the performance impact for either approach be?

No comments:

Post a Comment