Commit Graph

22 Commits

Author SHA1 Message Date
Manuel Trezza
19dea5bbd3 Fix aggregate geoNear with date query (#6540)
* added failing test case

* add date conversion for geoNear query

- geoNear stages were not parsed for date fields, but mongodb nodejs adapter requires date object

* reverted unnecessary code auto-formatting

* limited parsing to query property of geoNear stage

- the geoNear object contains parameter keys which could be identical to field names in the collection, which should not be parsed and changed, therefore restricting parsing only to query parameter key

* reverted unnecessary code auto-formatting

* added index type parameter to ensureIndex

- required to create geo index for geoNear test

* added geo index creation to test case

* fixed dates in test case

- test case likey failed due to date rounding

* added error output to console

- temporary, to find out why test fails on mongodb 3.6.9

* create seperate class to avoid multiple geo indices on TestObject class

- mongodb <4.0 does not allow nultiple geo indices on a class when using geoNear
- see https://docs.mongodb.com/v3.6/reference/operator/aggregation/geoNear/#behavior

* fixed incorrect result validation

- results were not ordered properly, so test validation failed sometimes

* removed error output to console

This reverts commit da81c515cbf8cb6edfd82f09ca3087457ac8c727.
2020-03-29 15:15:40 -05:00
Siddharth Ramesh
ef17dc4382 Group aggregation supports multiple columns for postgres (#6483)
* Group aggregation supports multiple columns for postgres

* Group aggregation supports multiple columns for postgres

* Group aggregation supports multiple columns for postgres

* Group aggregation supports multiple columns for postgres
2020-03-09 09:18:39 -07:00
Antonio Davi Macedo Coelho de Castro
84776810b8 Fix: aggregate not matching null values (#6043)
* Fix: aggregate not matching null values

* Exclude Postgres from this new test - it does not even support  and  is not working correctly - should be addressed separately
2019-09-11 09:13:15 -05:00
Antonio Davi Macedo Coelho de Castro
ac353ca8c2 Fix aggregate group id (#5994)
* Fix aggregate group id

* Improve implementation

* Add test case

* Fix postgres test - it does not work with group and sort at same time
2019-09-01 22:34:36 -07:00
Diamond Lewis
cf6e79ee75 Fix: Lint no-prototype-builtins (#5920)
* Fix: Lint no-prototype-builtins

Closes: https://github.com/parse-community/parse-server/issues/5842

Reference: https://eslint.org/docs/rules/no-prototype-builtins

* replace Object.hasOwnProperty.call
2019-08-14 14:57:00 -07:00
Antonio Davi Macedo Coelho de Castro
f3b84242d7 Fix month in aggregate tests (#5879) 2019-07-31 19:55:16 -07:00
Antonio Davi Macedo Coelho de Castro
db994ed473 Aggregate supports group by date fields (#5538)
* it actually supports group by date fields

* Changing the field name again to see Travis logs

* Adding match stage to the test

* Adding test for group by date fields on postgres
2019-04-26 20:33:03 -05:00
Diamond Lewis
daab3781a2 Support Distinct for special fields (#5144)
* Support Distinct for special fields

* update changelog
2018-10-26 10:21:42 -05:00
Florent Vilmart
045d941aef Remove request and request-promise from dev dependencies (#5077)
* removes from emailverificationtoken spec

* updates winston

* Updates ValidationAndPasswordsReset

* Use local request in schemas

* Removes request in rest.spec

* Removes request from PushRouter0

* removes request from public API

* removes request from index.spec

* Removes request form parse.push spec

* removes request from ParseInstallation spec

* Removes from ParseHooks

* removes request from ParseGlobalConfig.spec

* Removes request from ParseAPI.spec.js

* removes request from LogsRouter

* removes in features

* Filters undefined headers instead of crashing

* Removes request from ParseUser spec

* Removes usage of request in ParseFile.spec.js

* Removes request from AuthAdapters.js

* removes request-promise from ParseGeoPoint.spec

* Removes request-promise from ParseQuery spec

* remove request-promise from UserPII

* removes request-promise from EnableExpressErrorHandler

* Updates RevocableSessionUpgrade spec

* Update RestQuery

* Removes read preferenceOptionM

* ensure we forward auth from URL

* use request in CloudCode.spec.js

* Removes request-promise from JobSchedule.spec

* Removes rp from VerifyUserPassword.spec.js

* Removes rp from PasswordPolicy spec

* Removes rp from ParsePolygon spec

* Removes rp from fullTextSearch spec

* Removes rp from PArseQuery.Aggregate

* Ensure we properly forward errors

* Removes request and request-promise
2018-09-24 17:07:51 -04:00
Florent Vilmart
d83a0b6808 Use Prettier JS (#5017)
* Adds prettier

* Run lint before tests
2018-09-01 13:58:06 -04:00
Diamond Lewis
4802b1caec Add pipeline key to Aggregate (#4959)
* Add pipeline key to Aggregate

* clean up

* unit tests
2018-08-12 20:05:08 -05:00
Chris
5cdbde244a #4678: Converting strings to Date when schema.type is Date within agg… (#4743)
* #4678: Converting strings to Date when schema.type is Date within aggregate function

* Added test cases to test new date match aggregate query

* Added function to parse match aggregate arguments and convert necessary values to Date objects

* Added missing return value

* Improved code quality based on suggestions and figured out why tests were failing

* Added tests from @dplewis

* Supporting project aggregation as well as exists operator

* Excluding exists match for postgres

* Handling the $group operator similar to $match and $project

* Added more tests for better code coverage

* Excluding certain tests from being run on postgres

* Excluding one more test  from postgres

* clean up
2018-06-26 17:18:04 -05:00
Diamond Lewis
64388a31ad Aggregate allow multiple of same stage (#4835)
* Aggregate Allow Multiple Stages

* remove testing files

* nit

* spread them
2018-06-23 11:28:17 -05:00
Diamond Lewis
c36ef99368 Fix Aggregate Match Pointer (#4643) 2018-03-14 21:57:30 -05:00
Diamond Lewis
143b0f01cf PG: Add dates to group aggregate (#4549)
* PG: Add dates to group aggregate

* returns dates as UTC
2018-02-16 12:41:02 -06:00
Diamond Lewis
848a6cf7ae Distinct support for null (#4559)
* distinct support for null

* better testing
2018-02-16 10:44:42 -05:00
Diamond Lewis
64e568d000 Improved match aggregate (#4495)
* Improve aggregate queries

* using pg-promise query formatting

* match multiple comparison

* $or and complex match
2018-01-20 08:00:36 -06:00
Diamond Lewis
8ec07b83d0 Support pointer in aggregate query (#4493) 2018-01-08 20:42:08 -06:00
Diamond Lewis
6143988a82 Support pointer in distinct query (#4471)
* Support pointer in distinct query

* extract transform pointer string
2017-12-29 21:32:40 -06:00
Diamond Lewis
04f8673edd PG: Support for multiple projection in aggregate (#4469) 2017-12-29 17:39:16 +00:00
Benjamin Wilson Friedman
7944e2bd2d Remove hidden properties from aggregate responses (#4351)
* Remove hidden properties from aggregrate responses

* transform results from mongo & postgres

* Adjust ordering to comply with tests
2017-11-22 23:07:45 -08:00
Diamond Lewis
7223add446 Support for Aggregate Queries (#4207)
* Support for Aggregate Queries

* improve pg and coverage

* Mongo 3.4 aggregates and tests

* replace _id with objectId

* improve tests for objectId

* project with group query

* typo
2017-11-12 14:00:22 -05:00