Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Completed
Categories Database
Created by Guest
Created on Sep 25, 2019

Supporting hashed fields in compound indexes and shard keys

Hello, We have been using hashed keys to shard in regular clusters, they are useful for pre-sharding and keeping a balanced cluster without having to rely on the balancer. Global clusters and zone sharded clusters, we must use a compound shard key to identify both the zone and the shard key. MongoDB does not currently support compound shard keys containing hashed fields, making it cumbersome for us to use zone sharding. MongoDB could be improved by supporting hashed fields in compound keys.
  • ADMIN RESPONSE
    Aug 1, 2025
    Released in 4.4 https://docs.mongodb.com/manual/release-notes/4.4/index.html#compound-hashed-shard-keys
  • Attach files