Criteria.prototype.where >= 1.1.0

Purpose

Target a specific field

Syntax

Criteria#where ( Stringname );

Parameters

name
The name of the field to target

Return values

Criteria

Augmented reference to the current class, with the wanted field as its selection

Examples

Target a field and see if it equals something

// Get an instance of the "Page" model
var Page = Model.get('Page');

// Calling "find" on that model without arguments returns a criteria
var criteria = Page.find();

// Now we can target some field
criteria.where('title').equals('My pretty title');

// And finally, we can use this to query something
var result = await Page.find('first', criteria);