Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
037ab5a
feat: containedIn function implementation
harshithad0703 Feb 29, 2024
847a015
test: :white_check_mark: test case for conatinedIn function
harshithad0703 Feb 29, 2024
57040d5
Merge pull request #146 from contentstack/feat/cs-43910-containedIn-q…
harshithad0703 Mar 1, 2024
461f60f
feat: notContainedIn implementation
harshithad0703 Mar 1, 2024
88cf053
test: unit and api test case for not contained in
harshithad0703 Mar 1, 2024
9189d1b
changed the it statements in test cases
harshithad0703 Mar 1, 2024
1ae922c
updated docs and function name
harshithad0703 Mar 1, 2024
43487ff
updated docs and implementation
harshithad0703 Mar 1, 2024
5f9ad5e
chore: updated changeLog
harshithad0703 Mar 1, 2024
03ebd86
chore: :package: updated package files
harshithad0703 Mar 1, 2024
66534c4
Merge pull request #147 from contentstack/feat/cs-43911-notContainedI…
harshithad0703 Mar 1, 2024
e5ed42a
feat: notExists query operator implementation
harshithad0703 Mar 5, 2024
1524972
test: unit and api tests for notExists operator
harshithad0703 Mar 5, 2024
6530641
test: updated unit test assertion
harshithad0703 Mar 5, 2024
a3d6640
removed console log
harshithad0703 Mar 5, 2024
980b809
Merge pull request #151 from contentstack/feat/cs-43912-query-operato…
harshithad0703 Mar 5, 2024
ca901b7
fix: added tag latest to npm publish
abhinav-from-contentstack Mar 7, 2024
6346656
Merge branch 'v4-beta/next' of github.com:contentstack/contentstack-j…
abhinav-from-contentstack Mar 7, 2024
03231d2
refactor: :recycle: changes in query operators implementation
harshithad0703 Mar 7, 2024
0d4e502
docs: updated documentation for query operators
harshithad0703 Mar 7, 2024
75f4070
test: updated unit test cases
harshithad0703 Mar 7, 2024
6c14c97
feat: or operator implementation in query
harshithad0703 Mar 11, 2024
f3a0065
test: :white_check_mark: added unit and api tests for or operator
harshithad0703 Mar 11, 2024
667346a
docs: updated docs for or operator
harshithad0703 Mar 11, 2024
cfe3241
Merge pull request #156 from contentstack/feat/cs-43915-or-operator-q…
harshithad0703 Mar 11, 2024
4862591
feat: and query operator implementation
harshithad0703 Mar 12, 2024
432d11f
test: unit and api test cases for and operator query
harshithad0703 Mar 12, 2024
82987b9
Merge pull request #157 from contentstack/feat/cs-43916-and-operator-…
harshithad0703 Mar 12, 2024
4c26f05
feat: equalTo query operator implementation
harshithad0703 Mar 13, 2024
0df87b0
test: added unit and api test cases for equalTo operator
harshithad0703 Mar 13, 2024
c178ac4
docs: :memo: docs update for equalTo
harshithad0703 Mar 13, 2024
19d4261
feat: cs-43918-referenceIn operator implementation
harshithad0703 Mar 13, 2024
ddbb7eb
update changeLog and test->it
harshithad0703 Mar 13, 2024
fc55499
Merge pull request #158 from contentstack/feat/cs-43917-equalTo-query…
harshithad0703 Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated docs and function name
  • Loading branch information
harshithad0703 committed Mar 1, 2024
commit 1ae922c26f0f06ea6daf558e8bc218cd9fe68fce
6 changes: 3 additions & 3 deletions src/lib/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,19 @@ export class Query extends BaseQuery {
}

/**
* @method containedIn
* @method NoContainedIn
* @memberof Query
* @description Returns the raw (JSON) query based on the filters applied on Query object.
* @example
* import contentstack from '@contentstack/delivery-sdk'
*
* const stack = contentstack.Stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
* const query = stack.contentType("contentTypeUid").Query;
* const result = containedIn('fieldUid', ['value1', 'value2']).find()
* const result = notContainedIn('fieldUid', ['value1', 'value2']).find()
*
* @returns {Query}
*/
NotContainedIn(key: string, value: (string | number | boolean)[]): Query {
notContainedIn(key: string, value: (string | number | boolean)[]): Query {
this._queryParams[key] = { '$nin': value };
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion test/api/contenttype.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('ContentType Query API test cases', () => {
});

it('should get entries which does not match the fieldUid and values', async () => {
const query = await makeContentType('contenttype_uid').Query().NotContainedIn('title', ['test', 'test2']).find<TEntry>()
const query = await makeContentType('contenttype_uid').Query().notContainedIn('title', ['test', 'test2']).find<TEntry>()
if (query.entries) {
expect(query.entries[0]._version).toBeDefined();
expect(query.entries[0].title).toBeDefined();
Expand Down
2 changes: 1 addition & 1 deletion test/unit/contenttype.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('ContentType Query class', () => {
expect(query._queryParams).toStrictEqual({'fieldUID': {'$in': ['value']}});
});
it('should get entries which does not match the fieldUid and values', () => {
const query = contentType.Query().NotContainedIn('fieldUID', ['value', 'value2']);
const query = contentType.Query().notContainedIn('fieldUID', ['value', 'value2']);
expect(query._queryParams).toStrictEqual({'fieldUID': {'$nin': ['value', 'value2']}});
});
});