Users may sometimes want to figure out the hashed value for a certain document's shard key field. For instance the reason for doing that might be to identify the shard key range / chunk the document belongs to (when a hashed shard key is used). There a ways to do that, namely:
- Run a query on the shard key and inspect the index key (the `$returnKey` query option)
- Run a query on the shard key and inspect the index scan bounds in the $explain output
- Re-start the server in test mode and use the _hashBSONElement command
- Port BSONElementHasher into a custom application
All of these methods are pretty clumsy and inefficient when all you need is to get a hashed value for an arbitrary field. It would be much user-friendly if BSONElementHasher could be run on the client side (i.e. in the mongo shell) via a helper function.