Hey, I am trying to use the json filtering with no...
# orm-help
n
Hey, I am trying to use the json filtering with nodejs, but it is not giving me back what i expect. I have this json in column
values
Copy code
{
  "test": 10
}
and i trying to grab it this way:
Copy code
const entries = await this.prismaClient.accountEntity.findMany({
      where: {
        values: {
          path: ["test"],
          gt: 5,
        },
      },
    });
but it doesn't return anything. I would expect it to return all rows above 5. I have the following preview features:
previewFeatures = ["orderByRelation", "filterJson"]
I have tried to upgrade to version 2.25.0 but still no luck. Please let me know if im doing anything wrong
r
I’m pretty sure the comparison here being done is a string comparison. If you check for the value
{"test": 9}
it will work fine. I would suggest creating an issue here with the above use case so that we can look into this.
n
Yes i agree. When i was testing as well it seemed to be doing a string comparison when it shouldn't be.
💯 1
This one also pertains to JSON filtering. Seems like the feature is pretty new and has some work to be done. https://github.com/prisma/prisma/issues/7836
💯 1
r
Awesome! Thanks for opening the issue 🙂