I am getting the document to be updated like this. Idea is to add one more dictionary/map element to the array. The document looks like this:
{id:'id', cycles: [{"id":1, "name":"cycle 1"}] }
now i want to add cycle 2 to the cycles array but got stuck here:
Document doc = database.getDocument(docId);
// get the field to be updated, which is an array.
Array ar = doc.getArray(“cycles”); // getting the data here well.
MutableDocument mutableDocument = document.toMutable();
//what comes here please?
database.save(mutableDocument);