@nestjsx/crud Driver
ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.
Targets @nestjsx/crud — the popular CRUD framework for NestJS with a pipe-delimited query convention.
Configure
Section titled “Configure”import { DriverEnum, provideNgQubee } from 'ng-qubee';
bootstrapApplication(AppComponent, { providers: [provideNgQubee({ driver: DriverEnum.NESTJSX_CRUD })]});Wire format
Section titled “Wire format”| Concern | Output |
|---|---|
| Filters (single value) | filter=field||$eq||value |
| Filters (multi-value) | filter=field||$in||v1,v2 |
| Operator filters | full FilterOperatorEnum mapping — see below |
| Sort | sort=field,ASC&sort=other,DESC (repeatable) |
| Flat field selection | fields=col1,col2 |
| Joins | join=relation&join=other (repeatable) |
| Pagination | page=N&limit=N |
Operator filters
Section titled “Operator filters”FilterOperatorEnum translates to @nestjsx/crud’s $-prefixed condition operators:
import { FilterOperatorEnum } from 'ng-qubee';
qb.addFilterOperator('rating', FilterOperatorEnum.GTE, 4); // filter=rating||$gte||4qb.addFilterOperator('title', FilterOperatorEnum.CONTAINS, 'world'); // filter=title||$cont||worldqb.addFilterOperator('title', FilterOperatorEnum.ILIKE, 'World'); // filter=title||$contL||Worldqb.addFilterOperator('title', FilterOperatorEnum.SW, 'Intro'); // filter=title||$starts||Introqb.addFilterOperator('id', FilterOperatorEnum.IN, 1, 2, 3); // filter=id||$in||1,2,3qb.addFilterOperator('status', FilterOperatorEnum.NOT, 'draft'); // filter=status||$ne||draftqb.addFilterOperator('status', FilterOperatorEnum.NOT, 'a', 'b'); // filter=status||$notin||a,bqb.addFilterOperator('deletedAt', FilterOperatorEnum.NULL, true); // filter=deletedAt||$isnullqb.addFilterOperator('deletedAt', FilterOperatorEnum.NULL, false); // filter=deletedAt||$notnullqb.addFilterOperator('price', FilterOperatorEnum.BTW, 10, 50); // filter=price||$between||10,50Translation table
Section titled “Translation table”FilterOperatorEnum |
@nestjsx/crud operator |
|---|---|
EQ |
$eq |
GT / GTE / LT / LTE |
$gt / $gte / $lt / $lte |
CONTAINS |
$cont |
ILIKE |
$contL (case-insensitive contains) |
IN |
$in |
SW |
$starts |
BTW |
$between (arity-checked, emits min,max) |
NOT (single) |
$ne |
NOT (multi) |
$notin |
NULL (true) |
$isnull (no value segment) |
NULL (false) |
$notnull (no value segment) |
FTS / PHFTS / PLFTS / WFTS |
unsupported — throws UnsupportedFilterOperatorError |
Value shape rules
Section titled “Value shape rules”Enforced at call time — both throw InvalidFilterOperatorValueError:
BTWrequires exactly 2 values (min,max).NULLrequires exactly 1 boolean value (true→$isnull,false→$notnull).
Other operators leave shape validation to the server.
Feature matrix
Section titled “Feature matrix”| Method | Supported? | Notes |
|---|---|---|
addFilter / deleteFilters |
✓ | Folds to $eq (single) or $in (multi) |
addFilterOperator / deleteOperatorFilters |
✓ | See translation table above |
addSort / deleteSorts |
✓ | Repeatable sort=field,ASC params, uppercase direction |
addSelect / deleteSelect |
✓ | Emitted as fields=col1,col2 (flat column projection) |
addIncludes / deleteIncludes |
✓ | Emitted as repeatable join=relation params |
addEmbedded / deleteEmbedded |
✗ | PostgREST-only — throws UnsupportedEmbeddedError |
setLimit / setPage |
✓ | page + limit, page-based mode |
addFields / deleteFields / deleteFieldsByModel |
✗ | @nestjsx/crud has no per-model field selection (per-relation projection via join=rel||f1,f2 is out of scope) |
setSearch / deleteSearch |
✗ | The s={...} parameter is JSON-shaped, not a plain term — use operator filters instead |
Response shape
Section titled “Response shape”{ "data": [ { "id": 1, "name": "John" } ], "count": 10, "total": 48, "page": 2, "pageCount": 5}NestjsxCrudResponseStrategy reads the flat { data, count, total, page, pageCount } envelope and computes from/to from (page - 1) * count + 1 and min(page * count, total). The envelope carries no navigation links, so firstPageUrl / prevPageUrl / nextPageUrl / lastPageUrl resolve to undefined unless you override their paths via IConfig.response.
Customising response paths
Section titled “Customising response paths”provideNgQubee({ driver: DriverEnum.NESTJSX_CRUD, response: { data: 'items', total: 'totalCount' }});Defaults are encoded in NestjsxCrudResponseOptions.