la flame
PPrisma
•Created by la flame on 9/29/2024 in #help-and-questions
JSON Filtering on object key value inside array example from doc doesn't work
model Test {
id String @id @default(uuid()) @db.Uuid
data Json
}
await db.Test.create({data: {data: [{petName:"Claudine"}, {petName: "Sunny"}]}}){ id: 'eb4fd0ac-2039-4e25-99bf-754573af3622', data: [ { petName: 'Claudine' }, { petName: 'Sunny' } ] }
await db.Test.create({data: {data: [{petName:"Nanna"}]}}){ id: '5810d1c1-7ca9-4489-840a-dc3eae5db572', data: [ { petName: 'Nanna' } ] }
await db.Test.findMany({where: {data: {path: ["$[*].petName"], equals: "Claudine"}}})[]
await db.Test.findMany({where: {data: {path: ["$[*].petName"], array_contains: "Claudine"}}})How to make it work? clientVersion: '5.20.0'
1 replies
PPrisma
•Created by la flame on 4/24/2024 in #help-and-questions
[MongoDB] dup key: { itemId: null }, labels: {}
Started getting this error for no reason, because I made aggregate and found no itemId with count > 1
3 replies
PPrisma
•Created by la flame on 3/15/2024 in #help-and-questions
Prisma(postgres) stuck at `where: {assets: {none: {}}}`
I understand that the query is tight. But isn't there a way to do it? I have only ~1m records in
assets
.
My goal is to get entity
where assetsCount = 0
(without raw queries);
For example this query works lightning fast.
I'm asking if I'm doing things wrong or over-complicated. I'm not count this as prisma problem:heart:1 replies