Skip to content

Instantly share code, notes, and snippets.

@dbaba
Last active October 7, 2015 09:27
Show Gist options
  • Save dbaba/3142705 to your computer and use it in GitHub Desktop.
Save dbaba/3142705 to your computer and use it in GitHub Desktop.
ModelMapper.add() from MOAT js API Document
// Prepares an update operation.
var myArrayTypeMapper =
session.newModelMapperStub('MyArrayType');
// Creates or retrieves a model object
// obj.uid is automatically assigned
var obj = myArrayTypeMapper.newModelStub();
obj.myProperty = 'myValue';
obj.myIntProperty = 12345;
obj.myBooleanProperty = true;
// Enqueues the update operation
myArrayTypeMapper.add(obj, {
error : function(type, code) {
...
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment