String? getShard(Document doc) { if (shardFn == null) { return null; } return shardFn!(doc as Document<T>); }