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

Executors.update()

Executes the query, running a series of property updates on all matched objects.

// With no filters:
Employees.update(Employee.salary, 0, () =>
{
	// All employees now have a salary of $0.
});
// With a where() filter:
Employees
	.where(Employee.salary).lessThan(1000)
	.update(Employee.name, "Paul", employees =>
	{
		// All employees that have a salary less than $1 
		// have now been renamed to "Paul".
	});
// Update multiple properties at once:
Employees
	.update(Employee.name, "Paul")
	.update(Employee.salary, 1, () =>
	{
		// All employees have been renamed to "Paul"
		// now have a salary of $1.
	});

Method signature (TypeScript)

static update(property: StringProperty, value: string): UpdateFinalizer;
static update(property: NumberProperty, value: number): UpdateFinalizer;
static update(property: BooleanProperty, value: boolean): UpdateFinalizer;
static update(property: StringProperty, value: string, completeFn: () => void): void;
static update(property: NumberProperty, value: number, completeFn: () => void): void;
static update(property: BooleanProperty, value: boolean, completeFn: () => void): void;

Details

property
A reference to the Property to update.
value
The new value to set on each matched property.
completeFn
The function that will be called when the update has completed.
returns
If the function callback is omitted, the method returns void. Otherwise an object that contains the .update() method is returned, allowing multiple properties to be updated at once. (Only the last .update() call can specify the callback.)