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

Executes the query, deleting all matching objects.

// With no filters:
Employees.delete(() =>
{
	// All employees are now deleted.
});
// With a sort, and a limit:
Employees
	.sort(Employee.salary)
	.delete(10, () =>
	{
		// The 10 lowest-paid employees are now deleted.
	});
// With a sort, and a reverse limit:
Employees
	.sort(Employee.salary)
	.delete(-10, () =>
	{
		// The 10 highest paid employees are now deleted.
	});

Method signature (TypeScript)

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

Details

limit
The maximum number of objects to delete. Passing a negative number will delete objects starting from the end of the result set (similar to the behavior of Array.slice).
resultsFn
The function that will be called when the query has returned.
returns
void