diff --git a/src/stores/keys.rs b/src/stores/keys.rs index 07cc399..32bfcfe 100644 --- a/src/stores/keys.rs +++ b/src/stores/keys.rs @@ -210,7 +210,10 @@ impl KeysPersistentStorage for MongoPersistentStorage { async fn get_cacao_by_identity_key(&self, identity_key: &str) -> Result { info!("get_cacao_by_identity_key"); let filter = doc! { - "identities.identity_key": identity_key, + "identities.identity_key": { + "$exists": true, // https://docs.aws.amazon.com/documentdb/latest/developerguide/functional-differences.html#functional-differences.sparse-index + "$eq": identity_key, + }, }; info!("constructing not_found");