Before this change, when a property was configured with a default value
at LoopBack side and the database was returned a record with a missing
value for such property, then we would supply use the configured
default.
This behavior is problematic for reasons explained in #1692.
In this commit, we are introducing a new model-level setting called
`applyDefaultsOnReads`, which is enabled by default for backwards
compatibility.
When this setting is set to `false`, operations like `find` and
`findOrCreate` will NOT apply default property values on data returned
by the database (connector).
Please note that most of the other CRUD methods did not apply default
values on database data as long as the connector provided native
implementation of the operation, that aspect is not changing.
Also note that default values are applied only on properties with
`undefined` values. The value `null` does not trigger application of
default values. This is important because SQL connectors return
`null` for properties with no value set.
The new version of our config enabled function-paren-newline rule,
this commit fixes the codebase to use more consistent handling
of newlines when calling functions.
Differentiate between tests skipped by feature flags, and those
manually marked as skipped.
Tests that use the bdd.describe and bdd.it helper functions
will be marked as [UNSUPPORTED] if they are conditionally disabled.
* fix check for null
* add tests
* fix for early return
* Allow check for null and non-existent value
Some connectors uses a non existent prop instead of allowing null
Modified test case to look if null exists or the prop is non existent
* Check for null value with geo near query
* Apply requested changes
* change test to two users and simplify
* check error first
* Fix simple query test case with null value
* BDD for connectors w//o null support
* handle deep geo-near queries (#1216)
a dedicated mongKey is added in geo.nearFilter for mongoDB
fixes geo min distance tests as filter now expects an array
* Fix for string geoPoints
* Add geo point handle for ibmdb connectors
* Handle geo-point type for cassandra connector