示例#1
0
文件: document.cpp 项目: 3rf/mongo
 MutableValue MutableDocument::getNestedFieldHelper(const vector<Position>& positions,
                                                    size_t level) {
     if (level == positions.size()-1) {
         return getField(positions[level]);
     }
     else {
         MutableDocument nested (getField(positions[level]));
         return nested.getNestedFieldHelper(positions, level+1);
     }
 }
示例#2
0
文件: document.cpp 项目: 3rf/mongo
 MutableValue MutableDocument::getNestedFieldHelper(const FieldPath& dottedField,
                                                    size_t level) {
     if (level == dottedField.getPathLength()-1) {
         return getField(dottedField.getFieldName(level));
     }
     else {
         MutableDocument nested (getField(dottedField.getFieldName(level)));
         return nested.getNestedFieldHelper(dottedField, level+1);
     }
 }