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); } }
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); } }