While this isn't specifically for FoundationDB, I wrote this post many years ago about how to implement (secondary) indexes on top of a key-value store. [0]
https://misfra.me/2017/01/18/how-to-implement-secondary-inde...
https://misfra.me/2017/01/18/how-to-implement-secondary-inde...