Class: Relation

Parse.Relation(parent, key)

Creates a new Relation for the given parent object and key. This constructor should rarely be used directly, but rather created by Parse.Object.relation.

A class that is used to access all of the children of a many-to-many relationship. Each instance of Parse.Relation is associated with a particular parent object and key.

Constructor

new Relation(parent, key)

Parameters:
Name Type Description
parent Parse.Object The parent of this relation.
key String The key for this relation on the parent.

Methods

add(objects)

Adds a Parse.Object or an array of Parse.Objects to the relation.
Parameters:
Name Type Description
objects The item or items to add.

query() → {Parse.Query}

Returns a Parse.Query that is limited to objects in this relation.
Returns:
Type
Parse.Query

remove(objects)

Removes a Parse.Object or an array of Parse.Objects from this relation.
Parameters:
Name Type Description
objects The item or items to remove.

toJSON() → {Object}

Returns a JSON version of the object suitable for saving to disk.
Returns:
Type
Object