Search Builder
This is a abstract class. It is a base to make all kind of search request to OpenGate North API.
constructor
Constructor
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| parent | InternalOpenGateAPI |
❌ | this is ogapi instance |
| routes | object |
❌ | this defined the routes. One of those routes must be called on Builder before call build method. |
addSortAscendingBy(filterField)
Add ascending param into the sort search object
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| filterField | string |
❌ | This field must be allowed into the specific resource |
Retorna
Tip
Tipo: SearchBuilder
Ejemplos
addSortBy(filterField, typeSort)
Add ascending/descending param into the sort search object
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| filterField | string |
❌ | This field must be allowed into the specific resource |
| typeSort | string |
❌ |
Retorna
Tip
Tipo: SearchBuilder
Ejemplos
addSortDescendingBy(filterField)
Add descending param into the sort search object
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| filterField | string |
❌ | This field must be allowed into the specific resource |
Retorna
Tip
Tipo: SearchBuilder
Ejemplos
build()
Build a instance of Search
Retorna
Tip
Tipo: Search
Ejemplos
filter(filter)
The search request will have this filter
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| filter | FilterBuilder,object |
❌ |
Retorna
Tip
Tipo: SearchBuilder
Ejemplos
findAllFields(input)
Return a promise which it will contains an array with fields recommended with complete structure
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| input | * |
❌ |
Retorna
Tip
Tipo: Promise
findFieldPath(field)
Return a promise which it will contains an string with the path of a field
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| field | * |
❌ |
Retorna
Tip
Tipo: Promise
findFields(input)
Return a promise which it will contains an array with fields recommended with only identifier
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| input | * |
❌ |
Retorna
Tip
Tipo: Promise
limit(size, start)
Set reponse pagination.
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| size | number |
❌ | Defined the number of elements on response |
| start | number |
✅ | Defined the offset on response |
Retorna
Tip
Tipo: SearchBuilder
Ejemplos
removeSortBy(filterField)
Remove sort param from the search object
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| filterField | string |
❌ | This field must be allowed into the specific resource |
Retorna
Tip
Tipo: SearchBuilder
Ejemplos
withTimeout(ms)
The request will have a specific time out if it will be exceeded then the promise throw an exception
Parámetros
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| ms | number |
❌ | timeout in milliseconds |
Retorna
Tip
Tipo: SearchBuilder