loopback-deep-filter
v2.0.2
Published
loopback-component-filter update
Downloads
3
Readme
loopback-deep-filter
Developers**
Alan Mamani (creator) - [email protected] - https://gitlab.com/alanfernando93
Huáscar Miranda Martínez (collaborator) - [email protected] - https://github.com/huascarmm
Installation
Install using npm
;
$ npm install loopback-deep-filter
Install using yarn
;
$ yarn add loopback-deep-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_