Skip to content

Commit b85eb43

Browse files
feat: tags query operator implementation
1 parent 1a5d3f1 commit b85eb43

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
@@ -301,7 +301,7 @@ export class Query extends BaseQuery {
301301
}
302302

303303
/**
304-
* @method equalTo
304+
* @method referenceNotIn
305305
* @memberof Query
306306
* @description Returns the raw (JSON) query based on the filters applied on Query object.
307307
* @example
@@ -317,4 +317,22 @@ export class Query extends BaseQuery {
317317
this._parameters[key] = { '$nin_query': query._parameters }
318318
return this;
319319
}
320+
321+
/**
322+
* @method tags
323+
* @memberof Query
324+
* @description Returns the raw (JSON) query based on the filters applied on Query object.
325+
* @example
326+
* import contentstack from '@contentstack/delivery-sdk'
327+
*
328+
* const stack = contentstack.Stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
329+
* const query = stack.contentType('contenttype_uid').query().where('title', QueryOperation.EQUALS, 'value');
330+
* const entryQuery = await stack.contentType('contenttype_uid').query().tags(['tag1']).find<TEntry>();
331+
*
332+
* @returns {Query}
333+
*/
334+
tags(values: (string | number | boolean)[]): Query {
335+
this._parameters['tags'] = values;
336+
return this;
337+
}
320338
}

0 commit comments

Comments
 (0)