Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB logging QueryEvent type params is undefined #12319

Closed
millsp opened this issue Mar 14, 2022 · 0 comments · Fixed by prisma/prisma-engines#2771
Closed

MongoDB logging QueryEvent type params is undefined #12319

millsp opened this issue Mar 14, 2022 · 0 comments · Fixed by prisma/prisma-engines#2771
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: client types Types in Prisma Client topic: logging topic: mongodb
Milestone

Comments

@millsp
Copy link
Member

millsp commented Mar 14, 2022

Bug description

When using logging with MongoDB, params from the query event callback (QueryEvent) describe it as being a string but it's undefined.

How to reproduce

prisma.$on('query', (e) => {
    console.log('Query: ' + e.query)
    console.log('Params: ' + e.params)
    console.log('Duration: ' + e.duration + 'ms')
})

Expected behavior

Either params is typed as undefined or is just an empty string (eg. "[ ]" or "").

Prisma information

Use mongodb provider and preview feature.

Environment & setup

Type-level only

Prisma Version

3.11

Notes

@millsp millsp added kind/bug A reported bug. bug/2-confirmed Bug has been reproduced and confirmed. process/candidate topic: client types Types in Prisma Client tech/typescript Issue for tech TypeScript. team/client Issue for team Client. topic: logging labels Mar 14, 2022
cprieto added a commit to prisma/prisma-engines that referenced this issue Mar 17, 2022
 - We return an empty array for `params` in query loggin when using MongoDB
 - This fixes prisma/prisma#12319
 - A weird bug with logging to console not displaying return carriage is fix
cprieto added a commit to prisma/prisma-engines that referenced this issue Mar 17, 2022
- We return an empty array for `params` in query loggin when using MongoDB
 - This fixes prisma/prisma#12319
 - A weird bug with logging to console not displaying return carriage is fix
@matthewmueller matthewmueller added this to the 3.12.0 milestone Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. tech/typescript Issue for tech TypeScript. topic: client types Types in Prisma Client topic: logging topic: mongodb
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants