I have a collection of 100k+ documents where about 7% are missing the field used for a hashed shard key. While you cannot shard a collection where some documents are missing the shard key field, you can if you used a hashed shard key.
Prior to sharding, queries on the field (using
{CITY: null}) succeed, after sharding they appear to fail. The query is directed to the shards and they appear to process it, but mongos does not return any documents. Only happens if the field with null values is the shard key.
Have reproduced with mongo shell and pymongo, have not narrowed down enough to write JS test case.
Am not seeing any obvious errors in my mongos or mongod logs.