-
-
Notifications
You must be signed in to change notification settings - Fork 17
findWhere
Jorge Reyes edited this page May 29, 2015
·
3 revisions
Find one entity (or null if not found) according to a criteria structure ex: findWhere(entityName="Category", {category="Training"}), findWhere(entityName="Users",{age=40,retired=false});
###Returns
- This function returns any
###Arguments
Key | Type | Required | Default | Description |
---|---|---|---|---|
entityName | string | Yes | --- | |
criteria | struct | Yes | --- | A structure of criteria to filter on |
###Examples
// Find a category according to the named value pairs I pass into this method
var category = ormService.findWhere(entityName="Category", criteria={isActive=true, label="Training"});
var user = ormService.findWhere(entityName="User", criteria={isActive=true, username=rc.username,password=rc.password});