* add test cases for geoNear aggregation
Test cases do not have the `query` parameter set in $geoNear aggregation stage. this is to test for a reported potential issue when the parameter is not set.
* fixed potential issue when setting the geoNear.query parameter to undefined
see dicussion in https://github.com/parse-community/parse-server/pull/6540
* fixed duplicate index name in test
* Updated TOKEN_ISSUER to 'accounts.google.com'
Hi, I was getting this issue from today morning parse-server/Adapters/Auth/google.js was expecting the TOKEN_ISSUER to be prefixed with https:// but on debugging the original value was not having the prefix, removing https:// from TOKEN_ISSUER solved this bug. This issue is introduced in 4.3.0 as in 4.2.0 it is working fine currently I have downgraded the version to 4.2.0 for it to work properly and suggesting the changes please merge this PR.
* Update google.js
* Update AuthenticationAdapters.spec.js
* Update google.js
* Update google.js
* Optimize CLP pointer query
* remove console log
* Update changelog
* Fix flow type checker issues
* Remove unused properties
* Fix typo, add one more test case for coverage
* Add support for CLP entry of type Object
Co-authored-by: Musa Yassin-Fort <musa.yassin@bureapr.com>
Co-authored-by: Diamond Lewis <findlewis@gmail.com>
* Before Connect + Before Subscribe #1
* Cleanup and Documentation
* Add E2E tests
* Bump parse to 2.15.0
Co-authored-by: Diamond Lewis <findlewis@gmail.com>
* add fileKey encryption to GridFSBucketStorageAdapter
* remove fileAdapter options from test spec
* ensure promise doesn't fall through in getFileData
* switch secretKey to fileKey
* Support Metadata in GridFSAdapter
* Useful for testing in the JS SDK
* Adds new endpoint to be used with `Parse.File.getData`
* Allows file adapters to return tags as well as future data.
* fix tests
* Make getMetadata optional
* Revert "fix tests"
This reverts commit 7706da13c688027483974e854b5b24321fb070cd.
* improve coverage
* use pg-promise native pg-connection-string to parse uri instead of ParseConfigParser.js. The allows for a more felxible uri for ssl and other params
* added ssl config params and others to PostgresConfigParser
* forgot to add back the original client file
* need to read in file at path for pfx, ca, key, and key
* convert file buffer to string to be consistant with node-postgres examples
* Fixing objectId for Pointer in Postgres
* add test case for longer objectId pointer. Note that this test fails on Postgres before the addition of previous commit
* removed comment that wasn't needed
* Add test case for order option when extending the schema
* Remove fit
* upgrade to graphql-tools v5
revert #6515
Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
* Apply linter changes on files I'm about to update
My actual changes were quite difficult to find when buried in this sea
of style changes, which were getting automatically applied during a
pre-commit hook. Here I just run the hooks against the files I'm going
to be touching in the following commit, so that a reviewer can ignore
these automatically generated diffs and just view the meaningful commit.
* perf: Allow covering relation queries with minimal index
When finding objects through a relation, we're sending Mongo queries
that look like this:
```
db.getCollection('_Join:foo:bar').find({ relatedId: { $in: [...] } });
```
From the result of that query, we're only reading the `owningId` field,
so we can start by adding it as a projection:
```
db.getCollection('_Join:foo:bar')
.find({ relatedId: { $in: [...] } })
.project({ owningId: 1 });
```
This seems like the perfect example of a query that could be satisfied
with an index scan: we are querying on one field, and only need one
field from the matching document.
For example, this can allow users to speed up the fetching of user roles
in authentication, because they query a `roles` relation on the `_Role`
collection. To add a covering index on that, you could now add an index
like the following:
```
db.getCollection('_Join:roles:_Role').createIndex(
{ relatedId: 1, owningId: 1 },
{ background: true }
);
```
One caveat there is that the index I propose above doesn't include the
`_id` column. For the query in question, we don't actually care about
the ID of the row in the join table, just the `owningId` field, so we
can avoid some overhead of putting the `_id` column into the index if we
can also drop it from the projection. This requires adding a small
special case to the MongoStorageAdapter, because the `_id` field is
special: you have to opt-out of using it by projecting `{ _id: 0 }`.
* Update .travis.yml
testing error to see what happens...
* Update .travis.yml
Attempting to resolve postgres in CL by installing postgis via sudo instead of through apt/packages
* Update .travis.yml
* Update .travis.yml
* Update .travis.yml
Removed extra lines of postgres that were under "services" and "addons". I believe the "postgresql" line under "services" was installing the default of 9.6 and "addons" was installing postgres 11. My guess is the fail was occurring due to 9.6 being called sometimes and it never had postgis installed. If this is true, the solution is to only install one version of postgres, which is version 11 with postgis 2.5.
* Adding test case for caseInsensitive
Adding test case for verifying indexing for caseInsensitive
* Implementing ensureIndex
* Updated PostgresStorageAdapter calls to ST_DistanceSphere. Note this has a minimum requirement of postgis 2.2. Documented the change in the readme. This is address #6441
* updated postgres sections of contributions with newer postgres info. Also switched postgis image it points to as the other one hasn't been updated in over a year.
* more info about postgres
* added necessary password for postgres docker
* updated wording in contributions
* removed reference to MacJr environment var when starting postgres in contributions. The official image automatically creates a user named 'postgres', but it does require a password, which the command sets to 'postgres'
* added more time to docker sleep/wait to enter postgis commands. This will always take a few seconds because the db is installing from scratch everytime. If postgres/postgis images aren't already downloaded locally, it will take even longer. Worst case, if the command times out on first run. Stop and remove the parse-postgres container and run the command again, 20 seconds should be enough wait time then
* latest changes
* initial fix, need to test
* fixed lint
* Adding test case for caseInsensitive
Adding test case for verifying indexing for caseInsensitive
* Implementing ensureIndex
* Updated PostgresStorageAdapter calls to ST_DistanceSphere. Note this has a minimum requirement of postgis 2.2. Documented the change in the readme. This is address #6441
* updated postgres sections of contributions with newer postgres info. Also switched postgis image it points to as the other one hasn't been updated in over a year.
* more info about postgres
* added necessary password for postgres docker
* updated wording in contributions
* removed reference to MacJr environment var when starting postgres in contributions. The official image automatically creates a user named 'postgres', but it does require a password, which the command sets to 'postgres'
* added more time to docker sleep/wait to enter postgis commands. This will always take a few seconds because the db is installing from scratch everytime. If postgres/postgis images aren't already downloaded locally, it will take even longer. Worst case, if the command times out on first run. Stop and remove the parse-postgres container and run the command again, 20 seconds should be enough wait time then
* latest changes
* initial fix, need to test
* fixed lint
* Adds caseInsensitive constraints to database, but doesn't pass regular tests. I believe this is because ensureIndex in the Postgres adapter is returning wrong. Also, some issues with the caseInsensitive test case
* this version addes the indexes, but something still wrong with the ensureIndex method in adapter
* removed code from suggestions
* fixed lint
* fixed PostgresAdapter test case
* small bug in test case
* reverted back to main branch package.json and lock file
* fixed docker command in Contribute file
* added ability to explain the find method
* triggering another build
* added ability to choose to 'analyze' a query which actually executes (this can be bad when looking at a query plan for Insert, Delete, etc.) the query or to just setup the query plan (default, previous versions defaulted to 'analyze'). Alse added some comparsons on sequential vs index searches for postgres
* made sure to check that search actually returns 1 result. Removed prep time comparison between searches as this seemed to be variable
* added test cases using find and case insensitivity on fields other than username and password. Also added explain to aggregate method
* fixing issue where query in aggregate replaced the map method incorrectly
* reverted back to mapping for aggregate method to make sure it's the issue
* switched back to caseInsensitive check for email and username as it was causing issues
* fixed aggregate method using explain
* made query plain results more flexible/reusable. Got rid of droptables as 'beforeEach' already handles this
* updated CONTRIBUTING doc to use netrecon as default username for postgres (similar to old style). Note that the official postgres docker image for postgres requires POSTGRES_PASSWORD to be set in order to use the image
* left postgis at 2.5 in the contributing document as this is the last version to be backwards compatibile with older versions of parse server
* updating docker command for postgres
Co-authored-by: Arthur Cinader <700572+acinader@users.noreply.github.com>
* added hint to aggregate
* added support for hint in query
* added else clause to aggregate
* fixed tests
* updated tests
* Add tests and clean up
* added beforeSaveFile and afterSaveFile triggers
* Add support for explain
* added some validation
* added support for metadata and tags
* tests?
* trying tests
* added tests
* fixed failing tests
* added some docs for fileObject
* updated hooks to use Parse.File
* added test for already saved file being returned in hook
* added beforeDeleteFile and afterDeleteFile hooks
* removed contentLength because it's already in the header
* added fileSize param to FileTriggerRequest
* added support for client side metadata and tags
* removed fit test
* removed unused import
* added loging to file triggers
* updated error message
* updated error message
* fixed tests
* fixed typos
* Update package.json
* fixed failing test
* fixed error message
* fixed failing tests (hopefully)
* TESTS!!!
* Update FilesAdapter.js
fixed comment
* added test for changing file name
* updated comments
Co-authored-by: Diamond Lewis <findlewis@gmail.com>
* 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.