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

internal error: entered unreachable code: This shouldn't be reached; composite types are not supported in compound unique indices. #23960

Open
star123good opened this issue Apr 25, 2024 · 2 comments
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/client Issue for team Client. topic: composite-types topic: entered unreachable code topic: findMany() topic: mongodb

Comments

@star123good
Copy link

star123good commented Apr 25, 2024

Bug description

I can't use prisma.collection_name.findMany();

error msg:

internal error: entered unreachable code: This shouldn't be reached; composite types are not supported in compound unique indices.
This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.

How to reproduce

schema.prisma

Expected behavior

No response

Prisma information

model PoSpendByVendorFacilityContractNumberView {
  id          PoSpendByVendorFacilityContractNumberId   @id @map("_id")
  totalSpend  Json

  @@map("PoSpendByVendorFacilityContractNumber_view")
}

type PoSpendByVendorFacilityContractNumberId {
  facility        String
  vendor          String
  contractNumber  String[]
  month           Json
  year            Json
}

Environment & setup

  • OS: Ubuntu
  • Database: MongoDB
  • Node.js version: 20.10.0

Prisma Version

5.11.0

@star123good star123good added the kind/bug A reported bug. label Apr 25, 2024
@janpio
Copy link
Member

janpio commented Apr 25, 2024

Internal: Should one be able to use a composite type as @id?

@janpio janpio added team/client Issue for team Client. topic: mongodb topic: composite-types topic: findMany() bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. topic: entered unreachable code labels Apr 25, 2024
@janpio janpio changed the title internal error: entered unreachable code: This shouldn't be reached; composite types are not supported in compound unique indices. internal error: entered unreachable code: This shouldn't be reached; composite types are not supported in compound unique indices. Apr 25, 2024
@star123good
Copy link
Author

Internal: Should one be able to use a composite type as @id?

Yes, I think so
The following is a data of the collection.
{"_id":{"facility":"cogs","vendor":"Zimmer Biomet","contractNumber":["COGZIM03132023"],"month":{"$numberInt":"7"},"year":{"$numberInt":"2021"}},"totalSpend":{"$numberDecimal":"173581.00"}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/client Issue for team Client. topic: composite-types topic: entered unreachable code topic: findMany() topic: mongodb
Projects
None yet
Development

No branches or pull requests

2 participants