diff options
author | Karmen Liang <karmen.liang@mongodb.com> | 2020-08-04 16:45:33 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-07 21:08:48 +0000 |
commit | e5674a9c1cee8880163375469aa5494d0477c2e7 (patch) | |
tree | ceda6096d1e0589904b631b50bb3c9bbc2e043bc /src/mongo/db/cst/c_node.h | |
parent | f57a10895448d59716869a368a0f2f2b06391646 (diff) | |
download | mongo-e5674a9c1cee8880163375469aa5494d0477c2e7.tar.gz |
SERVER-48844 Add unwind agg stage to grammar
Diffstat (limited to 'src/mongo/db/cst/c_node.h')
-rw-r--r-- | src/mongo/db/cst/c_node.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/db/cst/c_node.h b/src/mongo/db/cst/c_node.h index 5d1fcafefd3..47cf8fec63e 100644 --- a/src/mongo/db/cst/c_node.h +++ b/src/mongo/db/cst/c_node.h @@ -76,6 +76,22 @@ struct CNode { return CNode{ObjectChildren{}}; } + /* + * Produce the payload of this CNode representing a string. Throws a fatal exception if this + * CNode does not represent a string. + */ + auto& getString() const { + return stdx::get<UserString>(payload); + } + + /* + * Produce the payload of this CNode representing a boolean. Throws a fatal exception if this + * CNode does not represent a boolean. + */ + auto& getBool() const { + return stdx::get<UserBoolean>(payload); + } + /** * Produce a string formatted with tabs and endlines that describes the CST underneath this * CNode. |