Skip to content

ds_key index on mongo collections are not unique #14

Description

@gerhardcit

Is it by design that ds_key are not unique indexes on mongodb?

 this._collections[ collectionName ].ensureIndex({ ds_key: 1 })

Since the value cannot be duplicated, should it not be more optimized to use?

 this._collections[ collectionName ].ensureIndex({ ds_key: 1 }, {uniq:1})

Would it not be more optimized to use ds_key as as the _id of the record?
(Just asking what the design considerations were?)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions