Foundationdb segment scan

How can foundationdb support shard scanning? As the underlying database, I want to use a stateless client to interact with foundationdb. Through this client, I can write fdb KV with a special prefix. However, when I want to perform shard scanning or query a specific key, I need to globally scan the entire database, which is obviously meaningless and will consume a lot of time. So is there any other way to support foundationdb shard scanning?