diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4eafe0947..83eda2da8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,9 @@ jobs: steps: - name: Fix usage of insecure GitHub protocol run: sudo git config --system url."https://github".insteadOf "git://github" + - name: Fix git protocol for Node 14 + if: ${{ startsWith(matrix.NODE_VERSION, '14.') }} + run: sudo git config --system url."https://github".insteadOf "ssh://git@github" - uses: actions/checkout@v2 - name: Use Node.js uses: actions/setup-node@v1 diff --git a/integration/test/ParseQueryAggregateTest.js b/integration/test/ParseQueryAggregateTest.js index dec1ada7a..0dcfb64ef 100644 --- a/integration/test/ParseQueryAggregateTest.js +++ b/integration/test/ParseQueryAggregateTest.js @@ -14,7 +14,7 @@ describe('Parse Aggregate Query', () => { it('aggregate pipeline object query', done => { const pipeline = { - group: { objectId: '$name' }, + $group: { _id: '$name' }, }; const query = new Parse.Query(TestObject); query.aggregate(pipeline).then(results => { @@ -24,7 +24,7 @@ describe('Parse Aggregate Query', () => { }); it('aggregate pipeline array query', done => { - const pipeline = [{ group: { objectId: '$name' } }]; + const pipeline = [{ $group: { _id: '$name' } }]; const query = new Parse.Query(TestObject); query.aggregate(pipeline).then(results => { assert.equal(results.length, 3); @@ -53,17 +53,17 @@ describe('Parse Aggregate Query', () => { const pipeline = [ { - match: { name: 'Hello' }, + $match: { name: 'Hello' }, }, { // Transform className$objectId to objectId and store in new field tempPointer - project: { + $project: { tempPointer: { $substr: ['$_p_pointer', 11, -1] }, // Remove TestObject$ }, }, { // Left Join, replace objectId stored in tempPointer with an actual object - lookup: { + $lookup: { from: 'TestObject', localField: 'tempPointer', foreignField: '_id', @@ -72,12 +72,12 @@ describe('Parse Aggregate Query', () => { }, { // lookup returns an array, Deconstructs an array field to objects - unwind: { + $unwind: { path: '$tempPointer', }, }, { - match: { 'tempPointer.value': 2 }, + $match: { 'tempPointer.value': 2 }, }, ]; await Parse.Object.saveAll([pointer1, pointer2, pointer3, obj1, obj2, obj3]); @@ -91,7 +91,7 @@ describe('Parse Aggregate Query', () => { it('aggregate pipeline on top of a simple query', async done => { const pipeline = { - group: { objectId: '$name' }, + $group: { _id: '$name' }, }; let results = await new Parse.Query(TestObject).equalTo('name', 'foo').aggregate(pipeline); diff --git a/package-lock.json b/package-lock.json index 49850e485..9d27435e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5278,9 +5278,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.31", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", - "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", + "version": "4.17.32", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.32.tgz", + "integrity": "sha512-aI5h/VOkxOF2Z1saPy0Zsxs5avets/iaiAJYznQFm5By/pamU31xWKL//epiF4OfUA2qTOc9PV6tCUjhO8wlZA==", "dev": true, "requires": { "@types/node": "*", @@ -6769,9 +6769,9 @@ } }, "bson": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.0.tgz", - "integrity": "sha512-VrlEE4vuiO1WTpfof4VmaVolCVYkYTgB9iWgYNOrVlnifpME/06fhFRmONgBhClD5pFC1t9ZWqFUQEQAzY43bA==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.1.tgz", + "integrity": "sha512-XkuFtlCzi0WSy8D6PMhvrQ/q8VlZHN/2bJ/shJglwuA6TPD2ZP/hHLB7iDxOEWVINHN/UVTxP4pqZqOKMXPIXg==", "dev": true, "requires": { "buffer": "^5.6.0" @@ -9346,6 +9346,12 @@ } } }, + "express-rate-limit": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-6.6.0.tgz", + "integrity": "sha512-HFN2+4ZGdkQOS8Qli4z6knmJFnw6lZed67o6b7RGplWeb1Z0s8VXaj3dUgPIdm9hrhZXTRpCTHXA0/2Eqex0vA==", + "dev": true + }, "ext": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", @@ -15352,9 +15358,9 @@ }, "dependencies": { "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz", + "integrity": "sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw==", "dev": true }, "tr46": { @@ -18097,8 +18103,8 @@ "dev": true }, "parse-server": { - "version": "git+https://github.com/parse-community/parse-server.git#d19acf1c1a594566409c152f513d670167aabdc8", - "from": "git+https://github.com/parse-community/parse-server.git#d19acf1c1a594566409c152f513d670167aabdc8", + "version": "git+https://github.com/parse-community/parse-server.git#62b3426b14e6a0943e261be803882d894acb7a07", + "from": "git+https://github.com/parse-community/parse-server.git#62b3426b14e6a0943e261be803882d894acb7a07", "dev": true, "requires": { "@babel/eslint-parser": "7.19.1", @@ -18115,6 +18121,7 @@ "cors": "2.8.5", "deepcopy": "2.1.0", "express": "4.18.2", + "express-rate-limit": "6.6.0", "follow-redirects": "1.15.2", "graphql": "16.6.0", "graphql-list-fields": "2.0.2", @@ -18131,6 +18138,7 @@ "mongodb": "4.10.0", "mustache": "4.2.0", "parse": "3.4.2", + "path-to-regexp": "0.1.7", "pg-monitor": "1.5.0", "pg-promise": "10.12.1", "pluralize": "8.0.0", @@ -19935,9 +19943,9 @@ } }, "safe-stable-stringify": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.1.tgz", - "integrity": "sha512-dVHE6bMtS/bnL2mwualjc6IxEv1F+OCUpA46pKUj6F8uDbUM0jCCulPqRNPSnWwGNKx5etqMjZYdXtrm5KJZGA==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.2.tgz", + "integrity": "sha512-gMxvPJYhP0O9n2pvcfYfIuYgbledAOJFcqRThtPRmjscaipiwcwPPKLytpVzMkG2HAN87Qmo2d4PtGiri1dSLA==", "dev": true }, "safer-buffer": { diff --git a/src/ParseQuery.js b/src/ParseQuery.js index 9ec6a65a9..7c303b2c0 100644 --- a/src/ParseQuery.js +++ b/src/ParseQuery.js @@ -832,7 +832,7 @@ class ParseQuery { if (!Array.isArray(pipeline)) { pipeline = [pipeline]; } - pipeline.unshift({ match: this._where }); + pipeline.unshift({ $match: this._where }); } const params = {