-
Notifications
You must be signed in to change notification settings - Fork 7
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
field-name-mapping-snake-case rule have an issue with MongoDB ID field. #330
Comments
Interesting. Thanks for reporting. We could add an option |
I see your discussion here: Currently |
@daeteck try this config for {
"requirePrefix": "_",
} |
Hi @maxh, Unfortunately if I put the This is my schema, and an example of an issue that the lint should warning is for example in the model Location the field timeZone that is not mapped to time_zone.
libs/database-library/common/prisma/schema.prisma ✖ |
Apologies, I think this is what we need here, please confirm: #362 |
@daeteck please try this config in 0.3.0:
|
Thank you @maxh It works perfect! |
Prisma documentation says that an id in MongoDb should be defined like this:
model Post {
id String @id @default(uuid()) @Map("_id")
text String
}
Where the id name of the primary key is mapped to MongoDB _id convention.
The issue is that if the rule field-name-mapping-snake-case it's enabled prisma-lint it throws this error:
Post.id x:x
error Field name must be mapped to "id". field-name-mapping-snake-case
The text was updated successfully, but these errors were encountered: