question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

path and other Json Filters are not working.

See original GitHub issue

Bug description

The only Json filters showing up in the prisma client are equals and not. All other Json Filters are not working in the most current version.

How to reproduce

Screen Shot 2021-09-10 at 3 59 32 PM

Expected behavior

I would expect to be able to use any of the other Json Filter’s that are available in the docs.

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
model User {
  id    Int     @id @default(autoincrement())
  email String  @unique
  name  String?
  posts Post[]
}

model Post {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  title     String
  content   String?
  published Boolean  @default(false)
  viewCount Int      @default(0)
  author    User?    @relation(fields: [authorId], references: [id])
  authorId  Int?
  data      Json?
}

Environment & setup

  • OS: Mac OS
  • Database: PostgreSQL
  • Node.js version: 14.7

Prisma Version

3.0.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pantharshit00commented, Sep 15, 2021

Are you using filterJson preview flag? That hasn’t left preview yet. You will need to have that listed as a preview feature in your schema if you want to use json filtering.

I tried to reproduce the above and I wasn’t able to reproduce when I used the preview flag.

0reactions
chuckstockcommented, Sep 16, 2021

@pantharshit00 Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSONPath - Filter expression is not working as expected
As a workaround, we can filter on the data -array and pull the ... This gives the same result as Jayway's JsonPath using...
Read more >
Filtering with JsonPath - Rows
In this lesson, we'll take a more in-depth look at JsonPath, specifically how to use filtering and regular expressions to find just the...
Read more >
Json filter is not working - Logstash - Discuss the Elastic Stack
hi, i'm trying to parse json file as simple as possible. field:value without touching the json order. when i run log stash, ...
Read more >
Filter on the existence of a JSON Field path #7617 - GitHub
Problem Given a JSON column containing an object with the possible state: interface MyJSONColumnValue { foo?: boolean; bar?
Read more >
Filter and pattern syntax - Amazon CloudWatch Logs
Strings that contain types other than alphanumeric characters and the ... The following metric filter uses NOT EXISTS to return JSON logs that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found