diff --git a/spec/ParseQuery.spec.js b/spec/ParseQuery.spec.js index 00d57f57..ef4a1990 100644 --- a/spec/ParseQuery.spec.js +++ b/spec/ParseQuery.spec.js @@ -3684,8 +3684,8 @@ describe('Parse.Query testing', () => { }); }); - it("includeAll", (done) => { - const child1 = new TestObject({ foo: 'bar', name: 'al' }); + it('includeAll', (done) => { + const child1 = new TestObject({ foo: 'bar', name: 'ac' }); const child2 = new TestObject({ foo: 'baz', name: 'flo' }); const child3 = new TestObject({ foo: 'bad', name: 'mo' }); const parent = new Container({ child1, child2, child3 }); @@ -3702,7 +3702,7 @@ describe('Parse.Query testing', () => { equal(result.child1.foo, 'bar'); equal(result.child2.foo, 'baz'); equal(result.child3.foo, 'bad'); - equal(result.child1.name, 'al'); + equal(result.child1.name, 'ac'); equal(result.child2.name, 'flo'); equal(result.child3.name, 'mo'); done(); diff --git a/src/RestQuery.js b/src/RestQuery.js index 21afbe35..51341028 100644 --- a/src/RestQuery.js +++ b/src/RestQuery.js @@ -558,6 +558,7 @@ RestQuery.prototype.runCount = function() { }); }; +// Augments this.response with all pointers on an object RestQuery.prototype.handleIncludeAll = function() { if (!this.includeAll) { return; @@ -575,6 +576,7 @@ RestQuery.prototype.handleIncludeAll = function() { } // Add fields to include, keys, remove dups this.include = [...new Set([...this.include, ...includeFields])]; + // if this.keys not set, then all keys are already included if (this.keys) { this.keys = [...new Set([...this.keys, ...keyFields])]; }