I’m new to mongo and prisma in javascript. This is a mongo query using prisma’s aggregateRaw method. The cond should do a case-insensitive string comparison. For example if $$property.property_name is “The Brough”, a regex /the br/i should be true. Prisma throws an error it doesn’t like the RegExp or /regex/ notation. This same query works from mongosh command line though.
Tag: prisma
Resolve promise inside javascript map function
I have gone through several questions and posts regarding how to accomplish this but none have worked. I have tried an array (no pun intended) of possible solutions involving Promise.*, thenable, await and none have worked. I have an array of payments that I extract from a Prisma db call, the object looks like this: I am trying to run
MongoDB & Prisma: unilateral M-to-N relation
Is there a way to make an unilateral m-to-n relation or must both collections have each other’s ids? I’m trying to do something like this: But prisma is making me add another field to Country to store the users ids… Like this: I don’t need that data and it’s not logically needed. Is there any way to bypass that? Any
Problem with prisma .upsert, Unkown argument
I have problem with prisma upsert(), I get info: PrismaClientValidationError: Invalid prisma.prismaUser.upsert() invocation: { where: { email: ‘viola@prisma.io’ ~~~~~ }, update: { name: ‘Viola the Magnificent’ }, create: { email: ‘viola@prisma.io’, name: ‘Viola the Magnificent’, profileViews: 0, role: ‘admin’ } } Unknown arg email in where.email for type prismaUserWhereUniqueInput. Did you mean id? Available args: type prismaUserWhereUniqueInput { id? My
ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation: ERROR [ExceptionsHandler] Invalid `prisma.executeRaw()` invocation:
my Stored procedure CREATE OR REPLACE PROCEDURE public.transfer_transactions( initiated_by integer, OUT transaction integer) LANGUAGE ‘plpgsql’ AS $BODY$ $BODY$; Calling the sp from nestjs prisma client async create(createTransactionDto: CreateTransactionDto) { const [callGetSequenceBlock, queryString] = await this.prisma.$transaction([ this.prisma.$executeRawCALL transfer_transactions(${login_id},@transaction);, this.prisma.$queryRawSELECT @transaction FROM DUAL;, ]); } error displayed while executing API Invalid prisma.executeRaw() invocation: Raw query failed. Code: 42703. Message: column “transaction_idout” does
get id value from req.body.id for new value of object
I have a field with id value in it. It auto created while created a new data. Concatenated with string. I have doing a try, but it gets undefined value. code: result: Answer Do you sure you sent the id property to the server? or was it just created by the ORM?
error An unexpected error occurred: “EPERM: operation not permitted, unlink ‘path_to_project\node_modules\prisma\query_engine-windows.dll.node’
I installed Prisma and I run npx primsa db push it pushed all tables to database successfully, after that I run npx prisma generate it tried to install @prisma/client and it fails with this error message: error An unexpected error occurred: “EPERM: operation not permitted, unlink ‘path_to_projectnode_modulesprismaquery_engine-windows.dll.node’ I tried to remove node_modules and re-install all modules but it not worked.
Array inside an map function seems to receive data, outside the map it was empty
I’m making a simple GET and POST with NodeJS and Express just for learning a little about PrismaJS with MySQL database. I want to pass the value of the array grouped to the creating function, when I use console.log(grouped) inside the map function I have the values I want, outside it keeps empty [], also when I’m passing him to