Skip to content

Commit 9719099

Browse files
Copilothotlong
andcommitted
fix: Address code review feedback
- Support both $nin and $notin operators consistently - Fix documentation examples to show AST conversion correctly Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent a42cda8 commit 9719099

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/core/src/adapters/objectstack-adapter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ export class ObjectStackAdapter<T = any> implements DataSource<T> {
192192
* @returns FilterNode AST array or simple object for flat key-value filters
193193
*
194194
* @example
195-
* // Simple filter
196-
* { status: 'active' } => { status: 'active' }
195+
* // Simple filter - converted to AST
196+
* { status: 'active' } => ['status', '=', 'active']
197197
*
198198
* // Complex filter with operators
199199
* { age: { $gte: 18 } } => ['age', '>=', 18]
@@ -214,7 +214,7 @@ export class ObjectStackAdapter<T = any> implements DataSource<T> {
214214
for (const [operator, operatorValue] of Object.entries(value)) {
215215
const astOperator = this.convertOperatorToAST(operator);
216216
if (astOperator) {
217-
if (operator === '$in' || operator === '$notin') {
217+
if (operator === '$in' || operator === '$nin' || operator === '$notin') {
218218
// For 'in' and 'notin', value should be an array
219219
conditions.push([field, astOperator, operatorValue]);
220220
} else if (operator === '$between') {

packages/data-objectql/src/ObjectQLDataSource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ export class ObjectQLDataSource<T = any> implements DataSource<T> {
187187
* @returns FilterNode AST array or simple object for flat key-value filters
188188
*
189189
* @example
190-
* // Simple filter
191-
* { status: 'active' } => { status: 'active' }
190+
* // Simple filter - converted to AST
191+
* { status: 'active' } => ['status', '=', 'active']
192192
*
193193
* // Complex filter with operators
194194
* { age: { $gte: 18 } } => ['age', '>=', 18]

0 commit comments

Comments
 (0)