Miroslav Bajtoš
a647bb0736
Do not apply default values on data from database
...
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.
2019-04-09 15:46:09 +02:00
Candy
3e02e36314
Fix assert as array does not guarantee order
2017-05-05 16:14:17 -04:00
Miroslav Bajtoš
5492e59207
Add two basic tests for "inq" operator
2017-01-20 13:04:28 +01:00
Amir Jafarian
e038b28e8c
Fix manually
2016-10-19 17:35:26 -04:00
Amir Jafarian
a1683fca59
Auto-update by eslint --fix
2016-10-19 17:04:05 -04:00
Simon Ho
a9d381605e
Add ilike and nilike operators ( #1136 )
...
Closes #633
Backport of #1091
2016-10-12 19:19:31 -07:00
Miroslav Bajtoš
ebcb5a0546
Ensure stable order of items in DAO.find()
...
When post-processing result of find operation, use "async.map"
instead of "async.each + array.push" to ensure the order of items
is preserved.
2016-07-13 15:25:34 +02:00
Simon Ho
65d6d6a508
Backport ESLint from master
2016-05-20 17:35:23 +02:00
Miroslav Bajtoš
289eac7565
eslint config 2.0 + remove extra empty lines
...
Upgrade eslint-config-loopback to ^2.0.0.
Remove extra empty lines to make `npm run lint` pass again.
[back-port of #909 ]
2016-04-19 17:06:04 +02:00
Miroslav Bajtoš
a5187765f6
Run `eslint --fix` with config from master
2016-04-18 16:00:04 +02:00
Miroslav Bajtoš
093a69328c
Insert copyright headers
2016-04-06 16:51:49 +02:00
Raymond Feng
682f6340d3
Optimze automigrate() to cut the test time signicantly
2015-08-27 15:59:58 -07:00
Simon Ho
57a9c40e16
Fix primary key checks
2015-08-27 13:59:43 -07:00
Simon Ho
cd71a37bfa
Relax id requirement for basic query operations
2015-08-20 02:57:53 -07:00
Simon Ho
b8f1598723
Add support for regex operator
2015-07-27 15:11:53 -07:00
Raymond Feng
d192b2ea05
Fix the test cases so that they be run with the mssql connector
...
For SQL server, if the PK is an identity, the id cannot be set for
insert.
2015-03-27 14:18:17 -07:00
Simon Ho
04f35b31b4
Memory connector returns updated records count
...
The memory connector now includes the number of updated items in its callback
when updating records.
2015-03-19 15:40:14 -07:00
Miroslav Bajtoš
d731252941
deleteAll returns number of deleted records
...
The number is returned as `data.ctx` to `cb(null, data)`.
2015-03-19 17:54:22 +01:00
Raymond Feng
f91399a307
Fix the test case so that at least one property is to be changed
2015-03-16 09:26:03 -07:00
rudzon
3953cc3e2f
test for updateAll
2015-02-24 13:56:57 +02:00
Raymond Feng
527d5f7a81
Fix findByIds test cases
2015-02-20 21:14:41 -08:00
Raymond Feng
6bc2a53afb
Tweak the model names used by tests to avoid mssql conflicts
2014-08-25 22:17:51 -07:00
Raymond Feng
3875c561e0
Add ping() to test connections
2014-08-20 16:31:23 -07:00
Fabien Franzen
b18384459a
Implemented findByIds
2014-07-29 15:01:47 +02:00
Raymond Feng
a2a91499dd
Fix the test case
2014-06-20 21:07:26 -07:00
Raymond Feng
86073cb480
Merge pull request #144 from strongloop/feature/add-update
...
Feature/add update
2014-06-20 12:28:48 -07:00
Raymond Feng
b07c36eab7
Use async for flow control
2014-06-20 12:05:42 -07:00
Raymond Feng
ad3af82923
Add support for updating multiple instances with query
2014-06-17 16:30:02 -07:00
Raymond Feng
4b9d98c6ce
Allows skip or offset
...
See https://github.com/strongloop/loopback/issues/336
2014-06-17 09:07:55 -07:00
Raymond Feng
bb57fcbe11
Fix the comparison for null/boolean values
2014-06-10 16:11:50 -07:00
Raymond Feng
b5816506e0
Add boolean tests
2014-06-06 09:28:08 -07:00
Raymond Feng
171642ff48
Make sure the records are sorted by seq
2014-06-06 09:09:56 -07:00
Raymond Feng
0191e3c2db
Add more tests
2014-06-06 08:48:05 -07:00
Raymond Feng
8f9dc1b867
Add support for logical operator (AND/OR)
2014-05-15 08:56:00 -07:00
Raymond Feng
2b8c1ebaee
Reformat the code
2014-01-24 09:09:53 -08:00
Raymond Feng
bcf112f042
Add index to name prop
2013-10-17 14:24:47 -07:00
Raymond Feng
59841a04a8
Set strict to false by default for non-relational data sources
2013-08-26 13:38:24 -07:00
Raymond Feng
463bf69ffc
Fix the test description
2013-08-19 10:35:52 -07:00
Raymond Feng
9482d3c7de
Fix the where option for delete
2013-08-18 10:58:53 -07:00
Ritchie Martori
d4ca20c01a
Add filter.fields support to dao and memory connector
2013-07-16 17:53:52 -07:00
Ritchie Martori
008b406dd7
model.find => model.findById, model.all => model.find
2013-06-24 12:42:58 -07:00
dgsan
1a91605340
Adds test for limit and skip + limit on `all()` queries as in docs.
...
(Currently not all adapters may pass.)
2013-05-13 22:04:28 -07:00
Anatoliy Chakkaev
136ea91fbf
Organize model.js
2013-05-13 22:04:28 -07:00
Anatoliy Chakkaev
c4d4b68413
Datatypes casting
2013-05-13 22:04:28 -07:00
Raymond Feng
3eb6869174
Revert "Fix the test case so that it passes in the same filter"
...
This reverts commit 7538601b79
.
2013-04-15 16:50:49 -07:00
Raymond Feng
7538601b79
Fix the test case so that it passes in the same filter
2013-04-10 21:09:09 -07:00
Anatoliy Chakkaev
43f395d653
Manually require init
2013-04-06 14:57:12 +04:00
Anatoliy Chakkaev
839791de2f
Upd tests
...
- skipping
- hook up redis-hq
- some stuff should be moved to advanced-querying tests
2013-03-29 11:43:04 +04:00
Anatoliy Chakkaev
e5f541c0b8
Uncomment tests
2013-03-27 22:00:50 +04:00
Anatoliy Chakkaev
2d6cc9aaee
Mongodb tolerance
2013-03-27 21:53:07 +04:00