-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
In my understanding the dataSize command uses min and max args that work like the $min and $max query operators, rather than the more flexible $gte and $lt operators. So it needs to also have an index identified (via the keyPattern arg) and the values in min and max must be compatible with that. Also if a { "mykeyfieldname": "hashed" } index is used the min and max args must be the hashed values.
All of the above is good for the sharding operations that it was created for, but it's confusing for users trying to fiddle with it on their own. I suggest we do more to highlight that it's an internal command; it's use is aligned with the shard chunk management code, and that using with hashed indexes is not possible unless you can provide the hashed values.