summaryrefslogtreecommitdiff
path: root/src/mongo/crypto/fle_crypto.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/crypto/fle_crypto.h')
-rw-r--r--src/mongo/crypto/fle_crypto.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mongo/crypto/fle_crypto.h b/src/mongo/crypto/fle_crypto.h
index 9e73fe28d5e..fd0d5a25cfd 100644
--- a/src/mongo/crypto/fle_crypto.h
+++ b/src/mongo/crypto/fle_crypto.h
@@ -331,6 +331,8 @@ struct ESCDocument {
*/
class FLETagQueryInterface {
public:
+ enum class TagQueryType { kInsert, kQuery };
+
virtual ~FLETagQueryInterface();
/**
@@ -347,6 +349,17 @@ public:
* Throws if the collection is not found.
*/
virtual uint64_t countDocuments(const NamespaceString& nss) = 0;
+
+ /**
+ * Get the set of counts from ESC for a set of tags. Returns counts for these fields suitable
+ * either for query or insert based on the type parameter.
+ *
+ * Returns a vector of zeros if the collection does not exist.
+ */
+ virtual std::vector<std::vector<FLEEdgeCountInfo>> getTags(
+ const NamespaceString& nss,
+ const std::vector<std::vector<FLEEdgePrfBlock>>& tokensSets,
+ TagQueryType type) = 0;
};
@@ -513,6 +526,17 @@ public:
const ESCTwiceDerivedValueToken& valueToken,
boost::optional<uint64_t> x,
FLEStatusSection::EmuBinaryTracker& tracker);
+
+ /**
+ * Get the set of counts from ESC for a set of tags. Returns counts for these fields suitable
+ * either for query or insert based on the type parameter.
+ *
+ * Returns a vector of zeros if the collection does not exist.
+ */
+ static std::vector<std::vector<FLEEdgeCountInfo>> getTags(
+ const FLEStateCollectionReader& reader,
+ const std::vector<std::vector<FLEEdgePrfBlock>>& tokensSets,
+ FLETagQueryInterface::TagQueryType type);
};