Is there api to add field to the document?

Please take a look at this topic:

Does it match your query?