MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / ExtPathExpression

Class ExtPathExpression

src/QLExpression.h:55–77  ·  view source on GitHub ↗

* This expression implements a MongoDB dot-separated path expansion (it returns all subdocuments * patching the given path, expanding arrays as necessary). */

Source from the content-addressed store, hash-verified

53 * patching the given path, expanding arrays as necessary).
54 */
55struct ExtPathExpression : IExpression, ReferenceCounted<ExtPathExpression>, FastAllocated<ExtPathExpression> {
56
57 Standalone<StringRef> path;
58 std::string strPath;
59 bool expandLastArray;
60 bool imputeNulls;
61
62 void addref() { ReferenceCounted<ExtPathExpression>::addref(); }
63 void delref() { ReferenceCounted<ExtPathExpression>::delref(); }
64
65 std::string toString() const override { return "ExtPath(" + strPath + ")"; }
66
67 ExtPathExpression(std::string const& strPath, bool const& expandLastArray, bool const& imputeNulls)
68 : strPath(strPath), expandLastArray(expandLastArray), imputeNulls(imputeNulls) {
69 path = encodeMaybeDotted(strPath);
70 }
71
72 GenFutureStream<Reference<IReadContext>> evaluate(Reference<IReadContext> const& document) override;
73
74 std::string get_index_key() const override {
75 return expandLastArray ? strPath : std::string();
76 } // FIXME: a.$n?.b.$n
77};
78
79#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected