Closed Aleclock closed 2 years ago
Maybe .contains('items', json.encode(poll.items.map((i) => i.toJson()).toList()))
?
Maybe
.contains('items', json.encode(poll.items.map((i) => i.toJson()).toList()))
?
unfortunately it doesn't work, I get same error
"Error: DbRequest Instance of 'DbRequest' malformed array literal: "[{"player":{"id":"409","name":"INSIGNE","team":"Napoli"},"votes":0,"description":""},{"player":{"id":"2530","name":"IBRAHIMOVIC","team":"Milan"},"votes":0,"description":""}]""
Maybe .contains('items', poll.items.map((i) => json.encode(i.toJson())).toList());
?
I get the same error, I don't know why in this way seems to be a map instead as a list
"Error: DbRequest Instance of 'DbRequest' malformed array literal: "{"{"player":{"id":"409","name":"INSIGNE","team":"Napoli"},"votes":0,"description":""}","{"player":{"id":"2530","name":"IBRAHIMOVIC","team":"Milan"},"votes":0,"description":""}"}""
Bug report
Describe the bug
I'm not sure if this is a bug or if I am missing something. I have a jsonb array column containing object (Player) converted in json. I'm trying to fetch all rows whose jsonb array column contains a specific object.
The insert method works fine doing
and getting something like
The select method gives me different errors and I can't fetch no rows.
To Reproduce
I get following error:
I get following error:
Expected behavior
Given a list of objects, I want to select from table all rows that partially match (contains at least one element) with the element stored in jsonb array column.
Thank you in advance.