From 660e06bfd62f5278af51137c601e30699c0e104a Mon Sep 17 00:00:00 2001 From: Chris Smith <1979423+chris13524@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:04:33 -0500 Subject: [PATCH] fix: query performance on DocumentDB (#171) * fix: query performance on DocumentDB * fix: oops --- src/stores/keys.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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");