@monkey-space/loopback-component-filter
v0.0.5
Published
loopback component to filter deep with relations
Downloads
7
Maintainers
Readme
loopback-component-filter
Installation
Install LoopbackFilterComponent using npm
;
$ npm install @monkey-space/loopback-component-filter
Basic Use
Configure and load LoopbackFilterComponent in the application constructor as shown below.
import {DeepCrudRepository} from '@monkey-space/loopback-component-filter';
replace DefaultCrudRepository to DeepCrudRepository in folder repositories
export class TrackingRoomRepository extends DeepCrudRepository<
TrackingRoom,
typeof TrackingRoom.prototype.id,
TrackingRoomRelations
> {
// Only the Find property is affected by the base repository DeepCrudRepository
...
Format filter
body example to filter format
{
"where": {
"payments": "undefined", // Returns all entities if `payments` is different to undefined (it is required)
"payments.name": "example",
"payments.description": "valueToEqual",
},
"include": ["payments"],
// Order, Fields, Limit remains the configuration
}
more examples, folder /src/tests/integration