I am creating a DB that indexes JSONs on top of a key value storage engine (LMDB or somewhat similar). When a new JSON needs to be indexed, I will create an entry for each field (AKA, JSON key), for example, for the field "firstname=123" I will create a reverse index "123 = jsonid". So this allows me to query all json objects in which firstname equals 123. My question is, how do I structure my indexes, in order to be able to answer a compound query (example firstname = X and lastname = Y) In ...