I have a collection that I've been trying to shard, but I can't get it to shard with the index that I gave it.
The collection in question uses a hashed index, which I created using:
db.bar.ensureIndex({"_id": "hashed"}, {"background": 1})
But when I try to shard said collection, using:
sh.shardCollection("foo.bar", {"_id": "hashed"})
I get an error saying:
command failed: { "ok" : 0, "errmsg" : "shard keys must all be ascending" }
Does this mean that the data I have in collection bar
needs to be ascending or that the version of Mongo that I'm using only supports range
shard-keys?