Improve DocumentPersister::getShardKeyQuery() to allow references to be shard keys