Commit Graph

27 Commits

Author SHA1 Message Date
Diamond Lewis
c6bc81caef Mongo: Fix reversing polygon coordinates (#4609)
* Fix reversing polygon coordinates

* comments fix

* real data test

* improved tests
2018-03-10 14:27:03 -06:00
Florent Vilmart
b754d51e8e chore(package): update jasmine to version 3.0.0 (#4553)
* 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
2018-02-17 09:55:30 -05:00
Benjamin Wilson Friedman
46af1b6955 Adds Relative Time options now,weeks & years (#4304)
* 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!
2017-11-01 13:31:08 -07:00
marvelm
6f1fe89948 Relative time queries (#4289)
* 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
2017-10-26 16:23:27 -04:00
Diamond Lewis
e6cc8204b3 Add Polygon Type To Schema / PolygonContain to Query (#3944)
* Added type polygon to schema

* refactoring and more tests

* fix tests

* update test and transform

* add support for polygonContains

* fix transform.mongoObjectToParseObject test

* add indexes for polygon

* index test

* postgres test fix

* remove invalid loop test

* add invalid loop test

* nit
2017-07-11 23:33:45 -04:00
nodechefMatt
ecf422b2d9 Mongo object to Parse object date serialization - avoid re-serialization of iso of type Date (#3389)
* Mongo object to Parse object date serialization - avoid nested ios

* Mongo object to Parse object date serialization

* Remove file from previous commit
2017-02-04 08:32:35 -08:00
Arthur Cinader
ca286b7108 Enable prefer-const lint rule (#3202) 2016-12-07 18:17:05 -05:00
Arthur Cinader
37daafc7b0 Add strip whitespace and trailing eol to spec too. (#3159) 2016-12-01 21:45:49 -05:00
Florent Vilmart
8c2c76dd26 Adds liniting into the workflow (#3082)
* initial linting of src

* fix indent to 2 spaces

* Removes unnecessary rules

* ignore spec folder for now

* Spec linting

* Fix spec indent

* nits

* nits

* no no-empty rule
2016-11-24 15:47:41 -05:00
Yuki Takeichi
4ea455b20a support Relation object saving (#3074)
* support Parse.Relation object save

* prevent Relation object from being saved in storage
2016-11-20 09:00:33 -05:00
Steven Shipton
0773523bc2 Ensure _acl is updated when _rperm and _wperm updated (#2701)
* Ensure _acl is updated when _rperm and _wperm updated

* alternative solution

* Only try to apply $set for permission updates
2016-09-17 11:05:33 -04:00
CongHoang
6e0a25dea0 fix export Bytes data type to JSON (#2409) 2016-08-09 12:05:46 -04:00
Drew
ab06055369 Postgres exclude failing tests (#2081)
* reload the right data

More passing postgres tests

Handle schema updates, and $in for non array columns

remove authdata from user and implement ensureUniqueness

Make some tests work, detect existing classes

Throw proper error for unique index violation

fix findOneAndUpdate

Support more types

support more type

Support boolean, fix _rperm/_wperm, add TODO

Support string types and also simplify tests

Move operator flattening into Parse Server and out of mongo adapters

Move authdata transform for create into Parse Server

Move authdata transforms completely in to Parse Server

Fix test setup

inline addSchema

Inject default schema to response from DB adapter

* Mark tests that don't work in Postgres

* Exclude one more test

* Exclude some more failing tests

* Exclude more tests
2016-06-17 12:59:16 -04:00
Drew
d559cb2382 Move transform acl (#2021)
* Move ACL transforming into Parse Server

For the database adapters, it will be more performant and easier to work with _rperm and _wperm than with the ACL object. This way we can type it as an array and so on, and once we have stronger validations in Parse Server, we can type it as an array containing strings of length < x, which will be much much better in sql databases.

* Use destructuring
2016-06-12 13:39:41 -07:00
Dan Huang
11301d9590 Fix an issue in MongoTransform where transforming object type fields with null values fails (#2029) 2016-06-10 13:44:41 -07:00
Drew
c9a138d9ca Break schemaController dependency. (#1901)
* Break dependency on MongoCollection for updateMany

* Move transformWhere usage into MongoTransform

* Pass parse schema into transformUpdate

* break dependency on schemaController

* remove schema parameter

* move key name validation up one level

* Move validation out of mongo adapter

* Move validation into Parse Server and transformUpdate in Mongo Adapter

* Update mongo adapter

* Use adapter API

* use and fix mongo adapter api

* Remove/rename stuff

* Kill transform in DBController

* better imports for transform

* Tidy ConfigRouter

* Remove schemaController in more places

* Remove comment
2016-05-24 17:21:20 -07:00
Drew Gross
7dca7e20b0 Remove schemaController parameter 2016-05-23 18:39:34 -07:00
Drew Gross
e440046be4 Remove getRelationFields 2016-05-23 18:39:34 -07:00
Drew Gross
f4b1f7b951 Remove all dependencies on schemaController 2016-05-23 18:39:34 -07:00
Drew Gross
00de555ecb remove one use of schemaController 2016-05-23 18:39:34 -07:00
Drew
614e1ac8e5 Move query logic into mongo (#1885)
* Move Parse Server logic into Parse Server and out of MongoAdapter

* Move untransforming up one level

* Make find() in MongoStorageAdapter

* Put nested object untransforming into it's own function

* Simplfy nested untransform

* Don't mess with inner object keys called _auth_data_*

* Prevent untransforming inner object keys named _p_*

* Fix inner keys named _rperm, _wperm

* Fix bugs with inner objects behaving strange when other fields have same name as key in specific circumstances

* remove params from untransform nested object

* Revert changes to find
2016-05-23 19:31:51 -04:00
Tyler Brock
3b4ae2d0a0 Write old ACL format in _acl in addition to new format (#1810) 2016-05-16 14:41:25 -07:00
Drew
e4998c256a Move field name validation logic out of mongo (#1752)
* Remove transformKey(...)

* Move validation logic into Parse Server and out of Mongo Adapter

* Fix nits
2016-05-13 15:28:14 -07:00
Drew Gross
d4bd21fcbc remove schema from transformWhere 2016-04-26 10:20:17 -07:00
Drew
9776362ab2 Begin isolating object creation code into an externalizable API. (#1569)
* Tidy up transformKeyValue

* Specialize transformKeyValue for object creation

* remove keys that never appear in creation requests

* rename function

* remove local var

* early exit for simple keys

* Refactor create

* Force class creation when creating an object

* Pass parameters to key value transformer

* No need to check for array in this func

* start using Parse Format schema in MongoTransform

* Remove call to getExpectedType

* add tests to ensure client can't see _PushStatus
2016-04-20 13:35:48 -07:00
Drew
ac839f75c7 Remove mongo object create format from Parse Server (#1516) 2016-04-18 12:45:48 -04:00
Florent Vilmart
1023baf20d DBController refactoring (#1228)
* Moves transform to MongoTransform

- Adds ACL query injection in MongoTransform

* Removes adaptiveCollection from DatabaseController

- All collections manipulations are now handled by a DBController
- Adds optional flags to configure an unsafe databaseController for direct
  access
- Adds ability to configure RestWrite with multiple writes
- Moves some transfirmations to MongoTransform as they output specific code

* Renames Unsafe to WithoutValidation
2016-04-14 19:24:56 -04:00