Skip to content

Instantly share code, notes, and snippets.

@arush arush/gist:5397620 forked from spacenick/gist:5397435
Created Apr 16, 2013

Embed
What would you like to do?
// You can do that in your Chrome Console
// Load the initial object, like an Attempt
var attempt = new Parse.Object("Attempt");
attempt.id = "myId";
attempt.fetch();
// Get the relation "handler" from the attempt object
var relation = attempt.relation("products");
// Add some products to the relation. They don't need to be fetched, just to have an "id" property
var product = new Parse.Object("Products");
product.id = "id1";
relation.add(product);
// Let's add others product, we can use the same object as only the id matters
product.id = "id2";
relation.add(product);
// let's save the object to reflect the changes in Parse
attempt.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.