Repository navigation
Closed
Labels
bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.topic: filterJsontopic: previewFeaturesIssue touches on an preview feature flag
Milestone
Description
Bug description
From @Weakky
One of the reason why I think we shouldn’t allow a string to be passed is that it can be misinterpreted as a support for JSON path. The reason postgres does not accept a string is because it does NOT support JSON path.
With Postgres, if you want to target a “deep” property, you need to do: path: ["a", "b"]. The equivalent on MySQL is "path": "$.a.b" (because MySQL does support JSON path)
How to reproduce
Follow the example in the release notes for 2.23.0 and then write
const posts = await prisma.post.findMany({
where: {
content: {
path: "type",
},
},
})Expected behavior
- Postgres:
path: string[] - MySQL:
path: string
Prisma information
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["filterJson"]
}
model Log {
id Int @id @default(autoincrement())
level Level
message String
meta Json
}
enum Level {
INFO
WARN
ERROR
}
Environment & setup
- OS: OSX
- Database: Postgres
Prisma Version
prisma : 2.23.0-dev.41
@prisma/client : 2.23.0-dev.41
Current platform : darwin
Query Engine : query-engine adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules/@prisma/engines/query-engine-darwin)
Migration Engine : migration-engine-cli adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt adf5e8cba3daf12d456d911d72b6e9418681b28b (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : adf5e8cba3daf12d456d911d72b6e9418681b28b
Studio : 0.393.0
Preview Features : filterJson
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.topic: filterJsontopic: previewFeaturesIssue touches on an preview feature flag
Activity