Nic Luciano
06/11/2021, 1:01 PMfilterJson preview feature to query where a path is undefined, i get A JSON path cannot be set without a scalar filter. at runtime, despite the InputJsonValue type allowing undefined. the json field is nullable, and has a default set to {} in prisma.
am i doing something wrong? or is support still limited? thank you. 🙂Ryan
06/11/2021, 1:02 PMNic Luciano
06/11/2021, 1:07 PMNic Luciano
06/11/2021, 1:43 PMnot does not behave as i'd expect. say i have three states:
{key:true}
{key:false}
{key:undefined} aka {}
{ path: ['key'], not: true } will return record 2
{ path: ['key'], not: false } will return record 1
in both cases i'd expect record 3 to be included, as undefined is not true or falseNic Luciano
06/11/2021, 1:44 PM{ path: ['key'], equals: undefined } (so, it's not exclusive to not)Ryan
06/11/2021, 1:44 PMkey but key doesn’t exist, so it shouldn’t be included. There should be a way to check for if a path existsRyan
06/11/2021, 1:45 PMundefined cannot be used here as undefined in TypeScript is equivalent to you omitting the value which is why this will not work. There should be a way of checking if a path exists and then I can get back to you as that suits your use case.Nic Luciano
06/11/2021, 1:46 PMRyan
06/11/2021, 2:07 PMNic Luciano
06/11/2021, 2:20 PM