I have a collection that is currently indexed / requested by the built-in "_id" (ObjectId). I do not want to spoof this key, because it is sequential (with a date prefix). The documentation for Mongo 2.4 says that I can outline the hash of this key, which sounds great. For instance:
sh.shardCollection ("records.active", {_id: "hashed"})
Question: should I first create a hashed index in the active collection with:
db.active.ensureIndex ({_ id: "hashed"})
Or is it not necessary? I do not want to waste space with more indexing than necessary.
Related question: if I create a hashed index with makeIndex ({_id: "hashed"}), can I remove the default id index? Will Mongo help accept requests in the _id field, hash them and run them against the hashed index?
Thank...
source
share