| 75 | } |
| 76 | |
| 77 | int 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 | |
| 94 | int insertElementRecursive(std::string fn, bson::BSONArray const& arr, Reference<IReadWriteContext> cx) { |
| 95 | if (fn[0] == '$') |
no test coverage detected