Add a Field to a Document

The following script demonstrates how to add a field named “MyField” to a document, with a value of “MyValue”.

Copy
function handler(document)
   document:addField("MyField", "MyValue");
   return true;
end