Replies: 1 comment
-
Anyone update on this as this is not currently available. You can't query JSON field data in tortoise I suppose? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi dear all!
Does Tortoise-ORM provide filtering by keys in JSONField?
Consider:
`class Item(Model):
name = fields.CharField()
data = fields.JSONField()
item = await Item.create(name='something', data = {'some_key': 'some_value'})
item = await Item.create(name='something', data = {'some_key': 'some_value1'})
item = await Item.create(name='something', data = {'some_key': 'some_value2'})
`
Can I filter something like bellow?:
items = await Item.filter(data__some_key__contains='some')
like Django does.
Beta Was this translation helpful? Give feedback.
All reactions