Ilkka Huotari
09/01/2022, 9:42 PM@relation
object type appear in the editor (VS Code), when using TypeScript and the query has include: { user: true }
...? It will work on the actual app when running it, but the editor doesn't realize the type should be there.Tejas H
09/02/2022, 3:03 AMLewis
09/02/2022, 5:45 AMmodel FishInventory {
id String @id @unique
fishInventory User? @relation(fields: [id], references: [id], onDelete: Cascade)
fish Json
}
This is the data structure in the database:
[{"name": "bass", "amount": 1}, {"name": "salmon", "amount": 1}]
This is something I've tried as shown on the docs:
const user = await prisma.fishInventory.findFirst({
where: {
id: "10",
fish: {
path: ["name"],
equals: "bass"
},
},
})
That returns null ^, not quite sure why.
If someone could show me how I am able to fully manipulate that data (adding, updating, and removing particular objects by "name" from that array and also being able to change the "amount"), that would be a massive help. I've been trying various methods for hours now and just can't figure it out!David Hancu
09/02/2022, 1:45 PMAustin Conder
09/02/2022, 3:20 PMJan Jagriฤ
09/02/2022, 3:33 PMUnable to load Node-API Library from /home/tobakz13/surapi/src/generated/client/libquery_engine-debian-openssl-1.1.x.so.node, Library may be corrupt.
I am looking for some pointers on how to solve this problem as I am not a server knowhow or prisma expert yet. My standard google research left me with no success.
I thank you all in advance and have a nice weekend.Christoffer
09/02/2022, 5:32 PMWilliam GM
09/02/2022, 6:20 PMFranklin
09/02/2022, 7:32 PMmodel AssetCollection {
id Int @id @default(autoincrement())
department String? @db.VarChar(50)
reviewed String? @db.VarChar(50)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy Int
updatedBy Int
locationId String
caseBarcode String
prep Int
assetCount Int
currStatus String?
bayLocation String?
assetEquip AssetEquip @relation(fields: [caseBarcode], references: [barId], onDelete: Cascade)
location Location @relation(fields: [locationId], references: [locNum], onDelete: Cascade)
assetPrep AssetPrep @relation(fields: [prep], references: [id], onDelete: Cascade)
}
David Hancu
09/02/2022, 7:45 PMMatt
09/02/2022, 7:56 PMBoo
09/02/2022, 8:55 PM.update
? meaning, if value is the same, does it still run the query?howdysourav
09/03/2022, 9:46 AM/ideas
that returns a response that looks like this:
{
"status": true,
"message": "All ideas",
"data": [
{
"id": 57,
"title": "a demo title",
"description": "a demo description",
"creatorId": "0xF95f8038Eb7874Cde88A0A9a8270fcC94f5C226e",
"votecount": 1,
},
{
"id": 23,
"title": "a demo title",
"description": "a demo description",
"creatorId": "0xF95f8038Eb7874Cde88A0A9a8270fcC94f5C226e",
"votecount": 8,
},
]
}
I want to implement a filter for the votecount field for a value greater than a given value. Can anyone please help here?David Hancu
09/03/2022, 11:27 AMDATABASE_URL
from another source rather than the .env
file (like a YAML file).
Let me know if this is something you'd like to see!yuno dream
09/03/2022, 3:09 PMGumnaam Haikoi
09/03/2022, 4:05 PMgigs
. I want the entire OR
part to run only if the filter
argument has been passed to this query since right now, executing the query without any arguments does not list all the gigs
. I know it must be a trivial thing, but I'm stuck at it since quite a while. Help please!
@Query()
async gigs(
@Args('title') title: string,
@Args('published') published: boolean,
@Args('filter') filter: string,
): Promise<Gig[]> {
return this.gigService.gigs({
where: {
title: title,
published: published,
OR: [
{ title: { contains: filter, mode: 'insensitive' } },
{ description: { contains: filter, mode: 'insensitive' } },
],
},
});
}
David Hancu
09/03/2022, 6:20 PMJonathan Marbutt
09/04/2022, 9:17 PMShannon Smith
09/05/2022, 12:04 AMOzzy Cardenas
09/05/2022, 1:23 AMRob
09/05/2022, 4:02 AMJared Fraser
09/05/2022, 4:08 AMn
represents it's being cast to a BigInt
Vignesh T.V.
09/05/2022, 6:56 AMMaksi
09/05/2022, 9:08 AMTaylor Lindores-Reeves
09/05/2022, 12:20 PMTaylor Lindores-Reeves
09/05/2022, 12:20 PMTaylor Lindores-Reeves
09/05/2022, 12:21 PMTaylor Lindores-Reeves
09/05/2022, 12:21 PMis
?`Taylor Lindores-Reeves
09/05/2022, 12:24 PMis
- proceeds to add is
and then get
`Unknown arg is
in where.OR.0.Auction.is for type AuctionWhereInput.`Taylor Lindores-Reeves
09/05/2022, 12:25 PM