Hi,
most of my documents consists of a unique group_id which groups documents. This group_id is in nearly every query I have. But I also have _id in some queries. My current sharding key consists of a compound of {group_id, _id}. Does this make sense at all? Or does the sharding key needs to be in every query completely? Or does MongoDB also uses partial sharding keys to hit the correct shard?
So if a query consists uses a query with qroup_id, field_A, field_B, will it hit the shards first where group_id is used also if _id is not used in the specific query?
Thanks & regards..
Daniel