Is there any mongoose library that can introspect collection and turn into mongoose Schema #14044
Replies: 3 comments
-
Not currently. It is tricky to do this with MongoDB in general because database doesn't have schema by default. |
Beta Was this translation helpful? Give feedback.
-
MongoDB compass can analyze schema https://www.mongodb.com/docs/compass/current/schema/#analyze-your-data-schema It is open source https://github.com/mongodb-js/compass/blob/main/packages/compass-schema/src/modules/schema-analysis.ts And it uses this library https://github.com/mongodb-js/mongodb-schema Based on what |
Beta Was this translation helpful? Give feedback.
-
Prisma did exactly what @Mihailoff suggested for their mongo support. See article here: |
Beta Was this translation helpful? Give feedback.
-
Like prisma db pull it reads your collection and turn into schema, where it helps save time then modify if there are some inconsistencies
Beta Was this translation helpful? Give feedback.
All reactions