You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
joinEager Fixes + $not Operator all with tests (#114)
* Fix $joinEager
Allow $mergeEager query
* add test
* fix bug
Allow paginated query
* add test
* fix bug
* Add $not operator
* objectify modified
* include $not in default operators
* add test
* Lint
* Fix $select and $noSelect with mutating methods
* were not honored with graph
* $select prevented update to update a whole object
(only selected parts were updated)
* a consequence of this commit is that
$eager is not need anymore to upsert data (partial fix#97)
* $noSelect always return input data instead of an empty object
* Fix#97 update with user query and upsert
* Enforce user query in patch with upsert
* Ensure user data and query are not overwritten
* in upsert graph, id is added if needed but not modified
and if data[id] and patch/update id mismatch it throw
* in get request, id is added to query so that the query must match
id and whole user query
* Improve $select after upsert
* now support '*' and 'table.*' in $select
* Updated README file
* new features
* migrating
* Update README.md
Co-authored-by: Dekel Barzilay <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+25-12Lines changed: 25 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,8 @@ operators are:
135
135
'$notILike',
136
136
'$or',
137
137
'$and',
138
-
'$sort'
138
+
'$sort',
139
+
'$not'
139
140
```
140
141
141
142
### Eager Queries
@@ -199,7 +200,9 @@ Note that all this eager related options are optional.
199
200
200
201
-**`$noSelect`** - skips SELECT queries in create, patch & remove requests. response data will be based on the input data.
201
202
202
-
-**`$null`** - filter based on if a column is NULL with REST support, e.g. `companies.find({ query: { ceo: { $null: false } } })`, `companies.find({ query: { ceo: { $null: 'false' } } })`
203
+
-**`$null`** - filter based on if a column is NULL with REST support, e.g. `companies.find({ query: { ceo: { $null: false } } })`, `companies.find({ query: { ceo: { $null: 'false' } } })`
204
+
205
+
-**`$not`** - filter based on if a query is NOT true. It can be used with an object `$not: { name: { $in: ['craig', 'tim'] } }` or array `$not: [ { $id: 1 }, { $id: 2 } ]`
203
206
204
207
-**`$between`** - filter based on if a column value is between range of values
Arbitrary relation graphs can be upserted (insert + update + delete) using the
337
340
upsertGraph method. See
338
-
[`examples`](https://vincit.github.io/objection.js/guide/query-examples.html#graph-upserts) for a better
339
-
explanation.
340
-
Runs on `update` and `patch` service methods when `id` is set.
341
+
[`examples`](https://vincit.github.io/objection.js/guide/query-examples.html#graph-upserts) for a better explanation.
341
342
342
-
_The relation being upserted must also be present in `allowedEager` option and
343
-
included in `$eager` query when using the `update` service method._
343
+
Runs on `update` and `patch` service methods when `id` is set. When the `data` object also contains `id`, then both must be the same or an error is thrown.
344
344
345
345
#### Service Options
346
346
@@ -385,11 +385,9 @@ be updated (if there are any changes at all).
385
385
### Graph insert
386
386
387
387
Arbitrary relation graphs can be inserted using the insertGraph method. Provides
388
-
the ability to relate the inserted object with its associations. Runs on the
389
-
`.create(data, params)` service method.
388
+
the ability to relate the inserted object with its associations.
390
389
391
-
_The relation being created must also be present in `allowedEager` option and
392
-
included in `$eager` query._
390
+
Runs on the `.create(data, params)` service method.
393
391
394
392
#### Service Options
395
393
@@ -866,8 +864,23 @@ The following breaking changes have been introduced:
866
864
- `namedEagerFilters` service option was removed. use Model's [`modifiers`](https://vincit.github.io/objection.js/recipes/modifiers.html#modifiers) instead
867
865
- Model's `namedFilters` property was renamed to `modifiers`
868
866
867
+
## Migrating to `feathers-objection` v6
868
+
869
+
`feathers-objection` 6.0.0 comes with usability and security updates
870
+
871
+
- `$not` operator is now available. It can be used with an object `$not: { name: { $in: ["craig", "tim"] } }` or array `$not: [ { $id:1 }, { $id:2 } ]`
872
+
- `$eager` is no longer needed with upsert operations
873
+
874
+
The following breaking changes have been introduced:
875
+
876
+
- Graph upsert now requires that `id` fields in the `data` object will match the `id` argument
877
+
- `$noSelect` now always return the input data
878
+
- `$select` is now honored with upsert methods
879
+
- `patch` method now enforce `params.query` with upsert
880
+
- NotFound error will be thrown when `get` & `update` methods are called with different values in `id` & `params.query.id`
0 commit comments