Skip to content

Commit 7018c6d

Browse files
feat: notContainedIn implementation
1 parent fd5ace8 commit 7018c6d

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
@@ -179,7 +179,25 @@ export class Query extends BaseQuery {
179179
* @returns {Query}
180180
*/
181181
containedIn(key: string, value: (string | number | boolean)[]): Query {
182-
this._queryParams[key] = value;
182+
this._queryParams[key] = { '$in': value };
183+
return this;
184+
}
185+
186+
/**
187+
* @method containedIn
188+
* @memberof Query
189+
* @description Returns the raw (JSON) query based on the filters applied on Query object.
190+
* @example
191+
* import contentstack from '@contentstack/delivery-sdk'
192+
*
193+
* const stack = contentstack.Stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
194+
* const query = stack.contentType("contentTypeUid").Query;
195+
* const result = containedIn('fieldUid', ['value1', 'value2']).find()
196+
*
197+
* @returns {Query}
198+
*/
199+
NotContainedIn(key: string, value: (string | number | boolean)[]): Query {
200+
this._queryParams[key] = { '$nin': value };
183201
return this;
184202
}
185203
}

0 commit comments

Comments
 (0)