-
Notifications
You must be signed in to change notification settings - Fork 1
find
AGenson edited this page Mar 4, 2018
·
11 revisions
Find all entities by query, and filter the fields of results
Property | Type | Default | Description |
---|---|---|---|
ctx |
Object |
required | Will serve to call a service action: ctx.call
|
search |
Object |
- |
Sub-Property | Type | Default | Description |
---|---|---|---|
query |
Object |
- | Clause WHERE --> ex: { username: "username", age: { $lt: 5 } }
|
filter |
Array.<String> |
- | ex: ["id", "username"]
|
limit |
Number |
- | ex: 10
|
Type: Promise
If entities were found :
// res = list of entities found
Promise.resolve({
name: "Operation Successful",
message: `Search Complete: ${res.length} element(s) found`,
data: res
});
Else (nothing found / an error occured) :
// res = list of entities found
Promise.reject({ ... });
cf - details about errors
- Home
- Features
- Install
- Usage
-
Database Functions
- Constructor
- Operations
- Database Errors
- Account Management