3.8/Drivers/NestJS Driver
NestJS Driver
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Targets nestjs-paginate.
Configure
Section titled “Configure”import { DriverEnum, provideNgQubee } from 'ng-qubee';
bootstrapApplication(AppComponent, { providers: [provideNgQubee({ driver: DriverEnum.NESTJS })]});Wire format
Section titled “Wire format”| Concern | Output |
|---|---|
| Simple filters | filter.field=value |
| Operator filters | filter.field=$operator:value |
| Sort | sortBy=field:ASC,field2:DESC |
| Flat select | select=col1,col2 |
| Search | search=term |
| Pagination | limit=15&page=1 |
Supported features
Section titled “Supported features”addFilter, addFilterOperator, addSelect, addSort, setSearch, setLimit, setPage and their delete counterparts.
Operator filters
Section titled “Operator filters”import { FilterOperatorEnum } from 'ng-qubee';
qb.addFilterOperator('age', FilterOperatorEnum.GTE, 18); // filter.age=$gte:18qb.addFilterOperator('id', FilterOperatorEnum.IN, 1, 2, 3); // filter.id=$in:1,2,3qb.addFilterOperator('price', FilterOperatorEnum.BTW, 10, 100); // filter.price=$btw:10,100Twelve operators: EQ, NOT, NULL, IN, GT, GTE, LT, LTE, BTW, ILIKE, SW, CONTAINS. The four *FTS variants are PostgREST-only and throw UnsupportedFilterOperatorError here.
Fetch all
Section titled “Fetch all”setLimit(-1) is accepted on the NestJS driver and honours nestjs-paginate’s convention for fetching all records in one response (server must opt in via maxLimit: -1):
qb.setLimit(-1); // emits limit=-1This is the only driver where -1 is valid — the others throw InvalidLimitError.
Unsupported features
Section titled “Unsupported features”addFields/deleteFields/deleteFieldsByModel→UnsupportedFieldSelectionError(useaddSelectinstead)addIncludes/deleteIncludes→UnsupportedIncludesError
Response shape
Section titled “Response shape”{ "data": [...], "meta": { "currentPage": 1, "totalItems": 100, "itemsPerPage": 10, "totalPages": 10 }, "links": { "first": "url", "previous": "url", "next": "url", "last": "url", "current": "url" }}Default key paths are configured in NestjsResponseOptions.