PG: Support for multiple projection in aggregate (#4469)

This commit is contained in:
Diamond Lewis
2017-12-29 11:39:16 -06:00
committed by Vitaly Tomilov
parent 6ba939994d
commit 04f8673edd
2 changed files with 38 additions and 19 deletions

View File

@@ -254,7 +254,8 @@ describe('Parse.Query Aggregate testing', () => {
rp.get(Parse.serverURL + '/aggregate/TestObject', options)
.then((resp) => {
resp.results.forEach((result) => {
expect(result.name !== undefined).toBe(true);
expect(result.objectId).not.toBe(undefined);
expect(result.name).not.toBe(undefined);
expect(result.sender).toBe(undefined);
expect(result.size).toBe(undefined);
expect(result.score).toBe(undefined);
@@ -263,6 +264,25 @@ describe('Parse.Query Aggregate testing', () => {
}).catch(done.fail);
});
it('multiple project query', (done) => {
const options = Object.assign({}, masterKeyOptions, {
body: {
project: { name: 1, score: 1, sender: 1 },
}
});
rp.get(Parse.serverURL + '/aggregate/TestObject', options)
.then((resp) => {
resp.results.forEach((result) => {
expect(result.objectId).not.toBe(undefined);
expect(result.name).not.toBe(undefined);
expect(result.score).not.toBe(undefined);
expect(result.sender).not.toBe(undefined);
expect(result.size).toBe(undefined);
});
done();
}).catch(done.fail);
});
it('project with group query', (done) => {
const options = Object.assign({}, masterKeyOptions, {
body: {