Getting Started

Basics

Query Modifiers

.where() .sort()

Query Predicates

.equals() .notEquals() .exists() .notExists() .startsWith() .endsWith() .contains() .greaterThan() .lessThan() .between() .outside()

Query Executors

.read() .first() .last() .count() .sum() .average() .min() .max() .update() .delete()

Login Methods

.exists() .login() .logout()

Instance Methods

.read() .delete()

Instance Login Methods

.login() .logout() .changePassword()

Misc

Back.then() Back.saved() Back.user() Back.eachProperty() Back.eachDescendant() IFile Property LoginResult

Back.eachDescendant

Performs a deep traversal of the object graph, starting at the specified object. Returns an array of each descendant, and/or invokes the specified callback function. Objects are never returned more than once, even if multiple properties in the subtree reference the same object. Does not traverse through objects or array that haven't been .read().

// Can be used to capture an array:
var bunnyDescendants = Back.eachDescendant(bun);
// Or we can specify an iteration function:
Back.eachDescendant(obj, (obj, containingObj, containingProperty, index) =>
{
	bunnyProp instanceof Property; // true
});

Method signature (TypeScript)

eachDescendant(
	obj: Instance,
	fn?: (inst: Instance, container?: Instance, containerProperty?: Property, index?: number) => any
): Instance[];

Details

obj
The starting object at which to begin traversing.
propertyFn
An optional iterator function to call for every decendant object. The function is passed 4 parameters:
  1. A reference to the current object.
  2. A reference to the object that contains the current object (or null if the traversal is currently at the top level).
  3. A reference to the Property object that identifies the property of the container object the current object is assigned.
  4. The index of the array that the model is contained in, or null if the model is not contained in an array.
returns
An array of descendant objects.