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

ConstructorPlural.where()

Filters query results based on a Property parameter and a following predicate method call. May be called multiple times per query.

Employees
	.where(Employee.name).equals("Paul")
	.where(Employee.salary).equals(1000)
	.first(employee =>
	{
		// Callback function
	});

Method signature (TypeScript)

static where(property: StringProperty): StringPredicates;
static where(property: NumberProperty): NumberPredicates;
static where(property: BooleanProperty): BooleanPredicates;
static where(property: EnumProperty): EnumPredicates;
static where(property: DateProperty): DatePredicates;
static where(property: FileProperty): FilePredicates;
static where(property: InstanceProperty): InstancePredicates;

Details

property
A reference to the Property that the filter is applied against. The Property must be owned by the originating constructor, so Bunny.where(Employee.salary) is valid, but Bunny.where(Treat.calories) is illogical and will generate an error. Not all properties are accepted (see the method signature).
returns
A predicates object. The specific type of the predicates object depends on the type of property specified. For example, passing a StringProperty returns the string predicates, and passing a DateProperty returns the date predicates.

Notes

Calling .where() multiple times per query applies multiple filters, resulting in a logical AND (&&) operation. OR operations are supported by the predicate method (see equals). A possible work-around is to run multiple queries and manually aggregate the resulting arrays.