You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jorge Reyes edited this page May 29, 2015
·
3 revisions
Finds and returns the first result for the given query or null if no entity was found. You can either use the query and params combination or send in an example entity to find.
###Returns
This function returns any
###Arguments
Key
Type
Required
Default
Description
query
string
No
---
params
any
No
[runtime expression]
example
any
No
---
###Examples
// My First PostormService.findIt("from Post as p where p.author='Luis Majano'");// With positional parametersormService.findIt("from Post as p where p.author=?",["Luis Majano"]);// with a named parameter (since 0.5)ormService.findIt("from Post as p where p.author=:author and p.isActive=:active",{ author="Luis Majano",active=true});// By Examplebook=ormService.new(entityName="Book",author="Luis Majano");ormService.findIt(example=book);