summaryrefslogtreecommitdiff
path: root/src/mongo/db/cst/c_node.h
diff options
context:
space:
mode:
authorJacob Evans <jacob.evans@10gen.com>2020-08-11 13:01:00 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-25 00:23:14 +0000
commitc785d74ce423a1a4e24e2886935995bdd2472a6c (patch)
treec8446c85926bfb0ed8aa1804a714e325409a118b /src/mongo/db/cst/c_node.h
parent0d82f47ba7e8fcd3fa656e323394d171b4a171d0 (diff)
downloadmongo-c785d74ce423a1a4e24e2886935995bdd2472a6c.tar.gz
SERVER-50254 Circumvent Projection AST for CST->DS translation
Diffstat (limited to 'src/mongo/db/cst/c_node.h')
-rw-r--r--src/mongo/db/cst/c_node.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/cst/c_node.h b/src/mongo/db/cst/c_node.h
index 06596d0ce70..f7a5099971c 100644
--- a/src/mongo/db/cst/c_node.h
+++ b/src/mongo/db/cst/c_node.h
@@ -31,7 +31,6 @@
#include "mongo/platform/basic.h"
-#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -40,6 +39,7 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/oid.h"
#include "mongo/bson/timestamp.h"
+#include "mongo/db/cst/compound_key.h"
#include "mongo/db/cst/key_fieldname.h"
#include "mongo/db/cst/key_value.h"
#include "mongo/platform/decimal128.h"
@@ -49,6 +49,7 @@
namespace mongo {
using UserFieldname = std::string;
+// These all indicate simple inclusion projection and are used as leaves in CompoundInclusion.
using NonZeroKey = stdx::variant<int, long long, double, Decimal128>;
// These are the non-compound types from bsonspec.org.
using UserDouble = double;
@@ -155,6 +156,7 @@ struct CNode {
*/
auto isInclusionKeyValue() const {
return stdx::holds_alternative<NonZeroKey>(payload) ||
+ stdx::holds_alternative<CompoundInclusionKey>(payload) ||
(stdx::holds_alternative<KeyValue>(payload) &&
stdx::get<KeyValue>(payload) == KeyValue::trueKey);
}
@@ -168,6 +170,9 @@ public:
using ObjectChildren = std::vector<std::pair<Fieldname, CNode>>;
stdx::variant<ArrayChildren,
ObjectChildren,
+ CompoundInclusionKey,
+ CompoundExclusionKey,
+ CompoundInconsistentKey,
KeyValue,
NonZeroKey,
UserDouble,