deepstream.io-storage-mongodb
deepstream.io-storage-mongodb copied to clipboard
ds_key index on mongo collections are not unique
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?)