sharding - Is it possible to query for a range of hashes of a hashed indexed key in mongodb? -
i have hashed based sharding enabled key "userid" in mongodb collection. possible documents hashed values of "userid" between, let's say, "abcd" , "cdef"?
thanks!
one way found use following query:
db.mycollection.find({ "$and": [ {_id: {"$gt": -5012941854059245285}}, {_id : {"$lt": -4712634714892678072}} ]}).hint({_id: "hashed"}) where long numbers hashed values of _id. works me, best way of doing so? can sure work upcoming releases of mongodb?
Comments
Post a Comment