deepstream.io-storage-mongodb icon indicating copy to clipboard operation
deepstream.io-storage-mongodb copied to clipboard

ds_key index on mongo collections are not unique

Open gerhardcit opened this issue 6 years ago • 0 comments

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?)

gerhardcit avatar Dec 10 '17 15:12 gerhardcit