Skip to content

Commit 1a5d3f1

Browse files
feat: referenceNotIn operator implementation
1 parent 3eee205 commit 1a5d3f1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/lib/query.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,5 +298,23 @@ export class Query extends BaseQuery {
298298
referenceIn(key: string, query: Query) {
299299
this._parameters[key] = { '$in_query': query._parameters }
300300
return this;
301-
}
301+
}
302+
303+
/**
304+
* @method equalTo
305+
* @memberof Query
306+
* @description Returns the raw (JSON) query based on the filters applied on Query object.
307+
* @example
308+
* import contentstack from '@contentstack/delivery-sdk'
309+
*
310+
* const stack = contentstack.Stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
311+
* const query = stack.contentType('contenttype_uid').query().where('title', QueryOperation.EQUALS, 'value');
312+
* const entryQuery = await stack.contentType('contenttype_uid').query().referenceNotIn('reference_uid', query).find<TEntry>();
313+
*
314+
* @returns {Query}
315+
*/
316+
referenceNotIn(key: string, query: Query) {
317+
this._parameters[key] = { '$nin_query': query._parameters }
318+
return this;
319+
}
302320
}

0 commit comments

Comments
 (0)