Skip to content

Commit

Permalink
- Updated docs on JSON column use
Browse files Browse the repository at this point in the history
- Bumped version to 4.4.1
  • Loading branch information
Dekel Barzilay committed Oct 11, 2019
1 parent bbc6fc2 commit 4f687dd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [v4.4.0](https://github.com/feathersjs-ecosystem/feathers-objection/tree/v4.4.0) (2019-10-11)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-objection/compare/v4.3.0...v4.4.0)

## [v4.3.0](https://github.com/feathersjs-ecosystem/feathers-objection/tree/v4.3.0) (2019-10-07)
[Full Changelog](https://github.com/feathersjs-ecosystem/feathers-objection/compare/v4.2.4...v4.3.0)

Expand Down
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,23 +246,41 @@ app.service('/user-todos').get({ userId: 1, todoId: 2 })
### JSON column
JSON column will be automatically converted from and to JS object/array and will
be saved as text in unsupported databases.
be saved as text in unsupported databases. it must be defined in the model class.
Query against a JSON column in PostgresSQL:
```js
app.service('companies').find({ query: { obj: { numberField: 1.5 } } });
app
.service('companies')
.find({ query: { obj: { numberField: { $gt: 1.5 } } } });
app.service('companies').find({
query: { obj: { 'objectField.object': 'string in obj.objectField.object' } }
query: {
obj: { stringField: 'string' }
}
});

app.service('companies').find({
query: {
obj: { numberField: 1.5 }
}
});

app.service('companies').find({
query: {
obj: { numberField: { $gt: 1.5 } }
}
});

app.service('companies').find({
query: {
obj: { 'objectField.object': 'string in obj.objectField.object' }
}
});

app.service('companies').find({
query: {
obj: { 'arrayField(0).object': 'string in obj.arrayField[0].object' }
}
});

app.service('companies').find({
query: {
arr: { '(0).objectField.object': 'string in arr[0].objectField.object' }
Expand Down Expand Up @@ -431,7 +449,7 @@ for more information.
### Models
Objection requires you to define
[Models](https://vincit.github.io/objection.js/api/model/#models) for your tables:
[Models](https://vincit.github.io/objection.js/api/model/#models) with [JSON Schema](https://json-schema.org/understanding-json-schema/) format for your tables:
users.model.js
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "feathers-objection",
"description": "A service plugin for ObjectionJS an ORM based on KnexJS",
"version": "4.4.0",
"version": "4.4.1",
"homepage": "https://github.com/feathersjs-ecosystem/feathers-objection",
"keywords": [
"feathers",
Expand Down

0 comments on commit 4f687dd

Please sign in to comment.