Skip to content

Commit 35cf485

Browse files
authored
Merge branch 'alpha' into ci-coverage
2 parents 621b9de + 9c0733f commit 35cf485

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed

changelogs/CHANGELOG_alpha.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [4.2.0-alpha.5](https://github.com/parse-community/Parse-SDK-JS/compare/4.2.0-alpha.4...4.2.0-alpha.5) (2023-08-27)
2+
3+
4+
### Features
5+
6+
* Add support for excluding keys in `ParseQuery.findAll` ([#2000](https://github.com/parse-community/Parse-SDK-JS/issues/2000)) ([012ba4c](https://github.com/parse-community/Parse-SDK-JS/commit/012ba4cdab1e3f853625f507c713cef2264a40dd))
7+
18
# [4.2.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/4.2.0-alpha.3...4.2.0-alpha.4) (2023-07-23)
29

310

integration/test/ParseQueryTest.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,23 @@ describe('Parse Query', () => {
16211621
assert.equal(result.get('slice'), 'pizza');
16221622
});
16231623

1624+
it('can exclude keys in findAll', async () => {
1625+
const object = new TestObject({
1626+
hello: 'world',
1627+
foo: 'bar',
1628+
slice: 'pizza',
1629+
});
1630+
await object.save();
1631+
1632+
const query = new Parse.Query(TestObject);
1633+
query.exclude('foo');
1634+
query.equalTo('objectId', object.id);
1635+
const [result] = await query.findAll();
1636+
assert.equal(result.get('foo'), undefined);
1637+
assert.equal(result.get('hello'), 'world');
1638+
assert.equal(result.get('slice'), 'pizza');
1639+
});
1640+
16241641
it('uses subclasses when creating objects', done => {
16251642
const ParentObject = Parse.Object.extend({ className: 'ParentObject' });
16261643
let ChildObject = Parse.Object.extend('ChildObject', {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse",
3-
"version": "4.2.0-alpha.4",
3+
"version": "4.2.0-alpha.5",
44
"description": "Parse JavaScript SDK",
55
"homepage": "https://parseplatform.org",
66
"keywords": [

src/ParseQuery.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -948,13 +948,10 @@ class ParseQuery {
948948

949949
const query = new ParseQuery(this.className);
950950
query._limit = options.batchSize || 100;
951-
query._include = this._include.map(i => {
952-
return i;
953-
});
951+
query._include = [...this._include];
952+
query._exclude = [...this._exclude];
954953
if (this._select) {
955-
query._select = this._select.map(s => {
956-
return s;
957-
});
954+
query._select = [...this._select];
958955
}
959956
query._hint = this._hint;
960957
query._where = {};

src/__tests__/ParseQuery-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,7 @@ describe('ParseQuery', () => {
18141814
q.select('size', 'name');
18151815
q.includeAll();
18161816
q.hint('_id_');
1817+
q.exclude('foo')
18171818

18181819
await q.findAll();
18191820
expect(findMock).toHaveBeenCalledTimes(1);
@@ -1824,6 +1825,7 @@ describe('ParseQuery', () => {
18241825
order: 'objectId',
18251826
keys: 'size,name',
18261827
include: '*',
1828+
excludeKeys: 'foo',
18271829
hint: '_id_',
18281830
where: {
18291831
size: {

0 commit comments

Comments
 (0)