Skip to content

Instantly share code, notes, and snippets.

@sjcotto
Last active August 29, 2015 14:03
Show Gist options
  • Save sjcotto/0289a606d1c9947bf878 to your computer and use it in GitHub Desktop.
Save sjcotto/0289a606d1c9947bf878 to your computer and use it in GitHub Desktop.
Api model relation
var test() {
var mc = model.open("modelId");
var entityId = "54afd345jn243a453";
var relation = mc.getRelation("persons").findBySource(entityId);
relation.add(someEntity);
relation.removeAll();
relation.removeById(idOfRelation);
var params = {
name : "Hola"
}
relation.find(params);
//busca en esa relacion todos los destinos que tengan ese parametros asociado
//y retorna una lista
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment