-
-
Save arush/5397620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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