@@ -24,8 +24,8 @@ The Data Engine acts as the "Driver" layer in the Hexagonal Architecture.
2424## TypeScript Usage
2525
2626``` typescript
27- import { BaseEngineOptions , DataEngineAggregateOptions , DataEngineAggregateRequest , DataEngineBatchRequest , DataEngineCountOptions , DataEngineCountRequest , DataEngineDeleteOptions , DataEngineDeleteRequest , DataEngineExecuteRequest , DataEngineFilter , DataEngineFindOneRequest , DataEngineFindRequest , DataEngineInsertOptions , DataEngineInsertRequest , DataEngineQueryOptions , DataEngineRequest , DataEngineSort , DataEngineUpdateOptions , DataEngineUpdateRequest , DataEngineVectorFindRequest } from ' @objectstack/spec/data' ;
28- import type { BaseEngineOptions , DataEngineAggregateOptions , DataEngineAggregateRequest , DataEngineBatchRequest , DataEngineCountOptions , DataEngineCountRequest , DataEngineDeleteOptions , DataEngineDeleteRequest , DataEngineExecuteRequest , DataEngineFilter , DataEngineFindOneRequest , DataEngineFindRequest , DataEngineInsertOptions , DataEngineInsertRequest , DataEngineQueryOptions , DataEngineRequest , DataEngineSort , DataEngineUpdateOptions , DataEngineUpdateRequest , DataEngineVectorFindRequest } from ' @objectstack/spec/data' ;
27+ import { BaseEngineOptions , DataEngineAggregateOptions , DataEngineAggregateRequest , DataEngineBatchRequest , DataEngineCountOptions , DataEngineCountRequest , DataEngineDeleteOptions , DataEngineDeleteRequest , DataEngineExecuteRequest , DataEngineFilter , DataEngineFindOneRequest , DataEngineFindRequest , DataEngineInsertOptions , DataEngineInsertRequest , DataEngineQueryOptions , DataEngineRequest , DataEngineSort , DataEngineUpdateOptions , DataEngineUpdateRequest , DataEngineVectorFindRequest , EngineAggregateOptions , EngineCountOptions , EngineDeleteOptions , EngineQueryOptions , EngineUpdateOptions } from ' @objectstack/spec/data' ;
28+ import type { BaseEngineOptions , DataEngineAggregateOptions , DataEngineAggregateRequest , DataEngineBatchRequest , DataEngineCountOptions , DataEngineCountRequest , DataEngineDeleteOptions , DataEngineDeleteRequest , DataEngineExecuteRequest , DataEngineFilter , DataEngineFindOneRequest , DataEngineFindRequest , DataEngineInsertOptions , DataEngineInsertRequest , DataEngineQueryOptions , DataEngineRequest , DataEngineSort , DataEngineUpdateOptions , DataEngineUpdateRequest , DataEngineVectorFindRequest , EngineAggregateOptions , EngineCountOptions , EngineDeleteOptions , EngineQueryOptions , EngineUpdateOptions } from ' @objectstack/spec/data' ;
2929
3030// Validate data
3131const result = BaseEngineOptions .parse (data );
@@ -68,7 +68,7 @@ Options for DataEngine.aggregate operations
6868| :--- | :--- | :--- | :--- |
6969| ** method** | ` string ` | ✅ | |
7070| ** object** | ` string ` | ✅ | |
71- | ** query** | ` Object ` | ✅ | Options for DataEngine.aggregate operations |
71+ | ** query** | ` Object ` | ✅ | |
7272
7373
7474---
@@ -108,7 +108,7 @@ Options for DataEngine.count operations
108108| :--- | :--- | :--- | :--- |
109109| ** method** | ` string ` | ✅ | |
110110| ** object** | ` string ` | ✅ | |
111- | ** query** | ` Object ` | optional | Options for DataEngine.count operations |
111+ | ** query** | ` Object ` | optional | |
112112
113113
114114---
@@ -136,8 +136,8 @@ Options for DataEngine.delete operations
136136| :--- | :--- | :--- | :--- |
137137| ** method** | ` string ` | ✅ | |
138138| ** object** | ` string ` | ✅ | |
139- | ** id** | ` string \| number ` | optional | ID for single delete, or use filter in options |
140- | ** options** | ` Object ` | optional | Options for DataEngine.delete operations |
139+ | ** id** | ` string \| number ` | optional | ID for single delete, or use where in options |
140+ | ** options** | ` Object ` | optional | |
141141
142142
143143---
@@ -186,7 +186,7 @@ Reference: [__schema0](./__schema0)
186186| :--- | :--- | :--- | :--- |
187187| ** method** | ` string ` | ✅ | |
188188| ** object** | ` string ` | ✅ | |
189- | ** query** | ` Object ` | optional | Query options for IDataEngine.find() operations |
189+ | ** query** | ` Object ` | optional | |
190190
191191
192192---
@@ -199,7 +199,7 @@ Reference: [__schema0](./__schema0)
199199| :--- | :--- | :--- | :--- |
200200| ** method** | ` string ` | ✅ | |
201201| ** object** | ` string ` | ✅ | |
202- | ** query** | ` Object ` | optional | Query options for IDataEngine.find() operations |
202+ | ** query** | ` Object ` | optional | |
203203
204204
205205---
@@ -268,7 +268,7 @@ This schema accepts one of the following structures:
268268| :--- | :--- | :--- | :--- |
269269| ** method** | ` string ` | ✅ | |
270270| ** object** | ` string ` | ✅ | |
271- | ** query** | ` Object ` | optional | Query options for IDataEngine.find() operations |
271+ | ** query** | ` Object ` | optional | |
272272
273273---
274274
@@ -280,7 +280,7 @@ This schema accepts one of the following structures:
280280| :--- | :--- | :--- | :--- |
281281| ** method** | ` string ` | ✅ | |
282282| ** object** | ` string ` | ✅ | |
283- | ** query** | ` Object ` | optional | Query options for IDataEngine.find() operations |
283+ | ** query** | ` Object ` | optional | |
284284
285285---
286286
@@ -306,8 +306,8 @@ This schema accepts one of the following structures:
306306| ** method** | ` string ` | ✅ | |
307307| ** object** | ` string ` | ✅ | |
308308| ** data** | ` Record<string, any> ` | ✅ | |
309- | ** id** | ` string \| number ` | optional | ID for single update, or use filter in options |
310- | ** options** | ` Object ` | optional | Options for DataEngine.update operations |
309+ | ** id** | ` string \| number ` | optional | ID for single update, or use where in options |
310+ | ** options** | ` Object ` | optional | |
311311
312312---
313313
@@ -319,8 +319,8 @@ This schema accepts one of the following structures:
319319| :--- | :--- | :--- | :--- |
320320| ** method** | ` string ` | ✅ | |
321321| ** object** | ` string ` | ✅ | |
322- | ** id** | ` string \| number ` | optional | ID for single delete, or use filter in options |
323- | ** options** | ` Object ` | optional | Options for DataEngine.delete operations |
322+ | ** id** | ` string \| number ` | optional | ID for single delete, or use where in options |
323+ | ** options** | ` Object ` | optional | |
324324
325325---
326326
@@ -332,7 +332,7 @@ This schema accepts one of the following structures:
332332| :--- | :--- | :--- | :--- |
333333| ** method** | ` string ` | ✅ | |
334334| ** object** | ` string ` | ✅ | |
335- | ** query** | ` Object ` | optional | Options for DataEngine.count operations |
335+ | ** query** | ` Object ` | optional | |
336336
337337---
338338
@@ -344,7 +344,7 @@ This schema accepts one of the following structures:
344344| :--- | :--- | :--- | :--- |
345345| ** method** | ` string ` | ✅ | |
346346| ** object** | ` string ` | ✅ | |
347- | ** query** | ` Object ` | ✅ | Options for DataEngine.aggregate operations |
347+ | ** query** | ` Object ` | ✅ | |
348348
349349---
350350
@@ -381,8 +381,8 @@ This schema accepts one of the following structures:
381381| ** method** | ` string ` | ✅ | |
382382| ** object** | ` string ` | ✅ | |
383383| ** vector** | ` number[] ` | ✅ | |
384- | ** filter ** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | Data Engine query filter conditions |
385- | ** select ** | ` string[] ` | optional | |
384+ | ** where ** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | |
385+ | ** fields ** | ` string[] ` | optional | |
386386| ** limit** | ` integer ` | optional | |
387387| ** threshold** | ` number ` | optional | |
388388
@@ -446,8 +446,8 @@ Options for DataEngine.update operations
446446| ** method** | ` string ` | ✅ | |
447447| ** object** | ` string ` | ✅ | |
448448| ** data** | ` Record<string, any> ` | ✅ | |
449- | ** id** | ` string \| number ` | optional | ID for single update, or use filter in options |
450- | ** options** | ` Object ` | optional | Options for DataEngine.update operations |
449+ | ** id** | ` string \| number ` | optional | ID for single update, or use where in options |
450+ | ** options** | ` Object ` | optional | |
451451
452452
453453---
@@ -461,11 +461,96 @@ Options for DataEngine.update operations
461461| ** method** | ` string ` | ✅ | |
462462| ** object** | ` string ` | ✅ | |
463463| ** vector** | ` number[] ` | ✅ | |
464- | ** filter ** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | Data Engine query filter conditions |
465- | ** select ** | ` string[] ` | optional | |
464+ | ** where ** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | |
465+ | ** fields ** | ` string[] ` | optional | |
466466| ** limit** | ` integer ` | optional | |
467467| ** threshold** | ` number ` | optional | |
468468
469469
470470---
471471
472+ ## EngineAggregateOptions
473+
474+ QueryAST-aligned options for DataEngine.aggregate operations
475+
476+ ### Properties
477+
478+ | Property | Type | Required | Description |
479+ | :--- | :--- | :--- | :--- |
480+ | ** context** | ` Object ` | optional | |
481+ | ** where** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | |
482+ | ** groupBy** | ` string[] ` | optional | |
483+ | ** aggregations** | ` Object[] ` | optional | |
484+
485+
486+ ---
487+
488+ ## EngineCountOptions
489+
490+ QueryAST-aligned options for DataEngine.count operations
491+
492+ ### Properties
493+
494+ | Property | Type | Required | Description |
495+ | :--- | :--- | :--- | :--- |
496+ | ** context** | ` Object ` | optional | |
497+ | ** where** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | |
498+
499+
500+ ---
501+
502+ ## EngineDeleteOptions
503+
504+ QueryAST-aligned options for DataEngine.delete operations
505+
506+ ### Properties
507+
508+ | Property | Type | Required | Description |
509+ | :--- | :--- | :--- | :--- |
510+ | ** context** | ` Object ` | optional | |
511+ | ** where** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | |
512+ | ** multi** | ` boolean ` | optional | |
513+
514+
515+ ---
516+
517+ ## EngineQueryOptions
518+
519+ QueryAST-aligned query options for IDataEngine.find() operations
520+
521+ ### Properties
522+
523+ | Property | Type | Required | Description |
524+ | :--- | :--- | :--- | :--- |
525+ | ** context** | ` Object ` | optional | |
526+ | ** where** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | |
527+ | ** fields** | ` [__schema1](./__schema1)[] ` | optional | |
528+ | ** orderBy** | ` Object[] ` | optional | |
529+ | ** limit** | ` number ` | optional | |
530+ | ** offset** | ` number ` | optional | |
531+ | ** top** | ` number ` | optional | |
532+ | ** cursor** | ` Record<string, any> ` | optional | |
533+ | ** search** | ` Object ` | optional | |
534+ | ** expand** | ` Record<string, [__schema2](./__schema2)> ` | optional | |
535+ | ** distinct** | ` boolean ` | optional | |
536+
537+
538+ ---
539+
540+ ## EngineUpdateOptions
541+
542+ QueryAST-aligned options for DataEngine.update operations
543+
544+ ### Properties
545+
546+ | Property | Type | Required | Description |
547+ | :--- | :--- | :--- | :--- |
548+ | ** context** | ` Object ` | optional | |
549+ | ** where** | ` Record<string, any> \| [__schema0](./__schema0) ` | optional | |
550+ | ** upsert** | ` boolean ` | optional | |
551+ | ** multi** | ` boolean ` | optional | |
552+ | ** returning** | ` boolean ` | optional | |
553+
554+
555+ ---
556+
0 commit comments