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
select d.id, d.data, d.mt_version
from public.mt_doc_mydocument as d
where d.data @? '$ ? (@.NestedCollection[*] == null || @.NestedCollection[*].size() == 0)'
If the collection is empty ("NestedCollection":[]), the second part will be always false which is caused by applying [*] to the collection, so @.NestedCollection[*].size() == 0 is false, but @.NestedCollection.size() == 0 seems to work fine.
I believe the issue was introduced with this change in CollectionIsEmpty:
The text was updated successfully, but these errors were encountered:
It seems like Marten is generating an incorrect SQL for scenarios when we want to check if a nested collection is empty, e.g.:
will produce something like
If the collection is empty (
"NestedCollection":[]
), the second part will be always false which is caused by applying[*]
to the collection, so@.NestedCollection[*].size() == 0
isfalse
, but@.NestedCollection.size() == 0
seems to work fine.I believe the issue was introduced with this change in CollectionIsEmpty:
The text was updated successfully, but these errors were encountered: