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

Function insertElementRecursive

src/ExtUtil.actor.cpp:77–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77int insertElementRecursive(std::string fn, bson::BSONObj const& obj, Reference<IReadWriteContext> cx) {
78 if (fn[0] == '$')
79 throw fieldname_with_dollar();
80 Key kp = encodeMaybeDotted(fn);
81
82 int nrFDBKeys = 1;
83 cx->set(kp, DataValue::subObject().encode_value());
84
85 auto scx = cx->getSubContext(kp);
86 for (auto i = obj.begin(); i.more();) {
87 auto e = i.next();
88 nrFDBKeys += insertElementRecursive(e, scx);
89 }
90
91 return nrFDBKeys;
92}
93
94int insertElementRecursive(std::string fn, bson::BSONArray const& arr, Reference<IReadWriteContext> cx) {
95 if (fn[0] == '$')

Callers 9

indexInsertActorMethod · 0.85
replacementActorMethod · 0.85
executeMethod · 0.85
Future<Void> doPopActorFunction · 0.85
Future<Void> doPullActorFunction · 0.85
Future<Void> doPushActorFunction · 0.85

Calls 8

encodeMaybeDottedFunction · 0.85
DataValueClass · 0.85
encode_valueMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
encode_key_partMethod · 0.80
setMethod · 0.45
getSubContextMethod · 0.45

Tested by

no test coverage detected