* GraphQL Object constraints
Implements the GraphQL Object constraints, which allows us to filter queries results using the `$eq`, `$lt`, `$gt`, `$in`, and other Parse supported constraints.
Example:
```
query objects {
findMyClass(where: {
objField: {
_eq: {
key: 'foo.bar',
value: 'hello'
},
_gt: {
key: 'foo.number',
value: 10
},
_lt: {
key: 'anotherNumber',
value: 5
}
}
}) {
results {
objectId
}
}
}
```
In the example above, we have the `findMyClass` query (automatically generated for the `MyClass` class), and a field named `objField` whose type is Object. The object below represents a valid `objField` value and would satisfy all constraints:
```
{
"foo": {
"bar": "hello",
"number": 11
},
"anotherNumber": 4
}
```
The Object constraint is applied only when using Parse class object type queries. When using "generic" queries such as `get` and `find`, this type of constraint is not available.
* Objects constraints not working on Postgres
Fixes the $eq, $ne, $gt, and $lt constraints when applied on an Object type field.
* Fix object constraint field name
* Fix Postgres constraints indexes
* fix: Object type composed constraints not working
* fix: Rename key and value fields
* refactor: Object constraints for generic queries
* fix: Object constraints not working on Postgres
* 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
* WIP: Integrate JS SDK v2
- Removes backbone style callbacks
- Use Promise instead of Parse.Promise
* Fixes ParseObject and ParseRelation
* Updates Parse.Query with promises
* Alls tests should pass
* Ensure a fresh user is used for each test
* Use REST implementation to avoid side effects for username/email duplicates
* Uses js sdk v2
* add support for geoWithin.centerSphere queries via withJSON
* added test for passing array of lat, lng instead of Parse.GeoPoint
* added postgres support
* added more tests
* improved tests and validation
* added more tests
* add failing test to demonstrate that you can't sort on a
field in an object.
* Only validate the base of the field name.
* fix test name
* Only test sort for mongo.
* pg order by nested object
* level 2 test
* Factor out operation to get a field's base name. Add comment.
* tweak comment wording so it wont make my grammar teacher angry.
* adding nor to specialQuerykeys
* adding nor suport
* adding test
* CRLF
* adding postgres NOR
* adding nor validation
* adding NOR test
* adding test amd fixing NOR cases
* revert the nor logic
* feat: Convert $regex value to RegExp object
* feat: Add lib folder
* Revert "feat: Add lib folder"
This reverts commit c9dfbcbf699ff220baeb2df5586a944d19808e5e.
* feat: Add $regex test in $all array
* test: Test regex with $all only in MongoDB
* Revert "test: Test regex with $all only in MongoDB"
This reverts commit d7194c7869dee98d924fbc2502593a198385dba1.
* feat: Add tests for containsAllStartingWith
* feat: Add postgres support
Thanks to @dplewis
* feat: Check that all values in $all must be regex or none
* test: Check that $all vaules must be regex or none
* feat: Update tests to use only REST API
* refactor: Move $all regex check to adapter
* feat: Check for valid $all values in progres
* refactor: Update function name
* fix: Postgres $all values regex checking
* fix: Check starts with as string
* fix: Define contains all regex sql function
* fix: Wrong value check
* fix: Check valid data
* fix: Check regex when there is only one value
* fix: Constains all starting with string returns empty with bad params
* fix: Pass correct regex value
* feat: Add missing tests
* feat: Add missing tests
* feat: Add more tests
* fix: Unify MongoDB and PostgreSQL functionality
* fix: Lint checks
* fix: Test broken
$regex in $all list must be { $regex: "string" }
* test for empty $all
* chore(package): update jasmine to version 3.0.0
Closes#4547
* Fixes failing tests for jasmine 3.0
Starting 3.0, done(something) will fail
* Update tests so they dont leverage var, but let and const
With jasmine 3.0, the randomization engine was making the test fails because of the scope of `var`
* Remove randomizer
* Use same adapter for PG tests, drop table to ensure the tests dont side effect
* Adds 'now' as an option in relative time
* reenables no-console in previous spot
* Adds weeks,months,years and abbreviations
* modified tests to address coverage
* month be gone!
* Add relative time queries
* Encode successful result
* Add integration test
* Add more error cases
* Remove unnecessary new Date
* Error when time has both 'in' and 'ago'
* naturalTimeToDate -> relativeTimeToDate
* Add $relativeTime operator
* Throw error if $relativeTime is invalid
* Add integration test for invalid relative time
* Exclude $exists query
* Only run integration tests on MongoDB
* Add it_only_db test helper
bd2ea87c1d/CONTRIBUTING.md (L23)
* Handle where val might be null or undefined
* Add integration test for multiple results
* Lowercase text before processing
* Always past if not future
* Precompute seconds multiplication
* Add shorthand for interval
hr, hrs
min, mins
sec, secs
* Throw error if $relativeTime is used with $exists, $ne, and $eq
* Improve coverage for relativeTimeToDate
* Add test for erroring on floating point units
* Remove unnecessary dropDatabase function
* Unit test $ne, $exists, $eq
* Verify field type
* Fix unit test for $exists
Unnest query object
* Adds error reproduction
* Fix transform in order to accept nested array results in $in/$nin
The error originated by the nesting of 2 array in $in [["..."]], using _.flatMap with those will guarantee at the lower level
that the query is properly resolved
* nits
* _.flatMap the $in/$nin values