public void writeFields(Document value) throws IOException {
        generator.writeObjectFieldStart(FIELDS);
        Iterator<Map.Entry<Field, FieldValue>> i = value.iterator();
        while (i.hasNext()) {
            Map.Entry<Field, FieldValue> entry = i.next();
            entry.getValue().serialize(entry.getKey(), this);
        }
        generator.writeEndObject();
    }
Utility method to easily serialize a single document ID as a remove
operation.

@param docId
           the document to remove or which has been removed
@return a document remove operation serialised as UTF-8 encoded JSON for
        the input document ID
document/src/main/java/com/yahoo/document/json/JsonWriter.java