// Now apply the changes to this document and prepare to coallesce the changes for the nested documents ...
int nextLevel = level + 1;
Map<String, LinkedList<Conversion>> nextLevelConversionsBySegment = new HashMap<String, LinkedList<Conversion>>();
for (Conversion conversion : conversions) {
Path path = conversion.getPath();
assert path.size() > level;
String segment = path.get(level);
if (path.size() == nextLevel) {
// This is the last segment for this path, so change the output document's field ...
changedFields.put(segment, conversion.getConvertedValue());
} else {
// Otherwise, the path is for the nested document ...
LinkedList<Conversion> nestedConversions = nextLevelConversionsBySegment.get(segment);