summaryrefslogtreecommitdiff
path: root/src/mongo/db/index/index_descriptor.h
diff options
context:
space:
mode:
authorRishab Joshi <rishab.joshi@mongodb.com>2022-12-25 01:28:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-25 03:35:52 +0000
commit6e7338e29df42e7119ecfc6916ee791c34cd27ac (patch)
tree938ddc5cb679e27b7124622b4c73aabfa51f535b /src/mongo/db/index/index_descriptor.h
parenta8b48a0d6b35afc238f4371c7f4bd24a6ae27a35 (diff)
downloadmongo-6e7338e29df42e7119ecfc6916ee791c34cd27ac.tar.gz
SERVER-68685 Adds new $_internalIndexKey agg expression.
Diffstat (limited to 'src/mongo/db/index/index_descriptor.h')
-rw-r--r--src/mongo/db/index/index_descriptor.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/index/index_descriptor.h b/src/mongo/db/index/index_descriptor.h
index e1ece388cc3..702b6e3f029 100644
--- a/src/mongo/db/index/index_descriptor.h
+++ b/src/mongo/db/index/index_descriptor.h
@@ -239,6 +239,19 @@ public:
}
/**
+ * Returns the field names from the index key pattern.
+ *
+ * Examples:
+ * For the index key pattern {a: 1, b: 1}, this method returns {"a", "b"}.
+ * For the text index key pattern {a: "text", _fts: "text", b: "text"}, this method returns
+ * {"a", "term", "weight", "b"}.
+ *
+ * Note that this method will not be able to resolve the field names for a wildcard index. So,
+ * for the wild card index {"$**": 1}, this method will return {"$**"}.
+ */
+ std::vector<const char*> getFieldNames() const;
+
+ /**
* Returns true if the key pattern is for the _id index.
* The _id index must have form exactly {_id : 1} or {_id : -1}.
* Allows an index of form {_id : "hashed"} to exist but