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.read()

Executes the query, providing an array of all matching objects.

// With no filters:
Employees.read(employees =>
{
	// employees is an array of all stored Employee objects.
});
// With a sort, and a limit:
Employees
	.sort(Employee.name)
	.read(10, employees =>
	{
		// employees is an array of the first 10 Employee objects sorted by .name
	});
// With a sort, and a reverse limit:
Employees
	.sort(Employee.name)
	.read(-10, employees =>
	{
		// employees is an array of the last 10 Employee objects sorted by .name
	});

Method signature (TypeScript)

read(limit: number, resultsFn: (results: Instance[]) => void): void;
read(resultsFn: (results: Instance[]) => void): void;

Details

limit
The maximum number of objects to return. Passing a negative number will return results starting from the end of the result set (similar to the behavior of slice).
resultsFn
The function that will be called when the query has returned. An array of instances is passed to the first parameter.
returns
void