prisma-mongo-json-schema-generator

0.0.2 • Public • Published

Prisma Mongo JSON Schema Generator

This package contains two things:

Credit

This package is a fork of prisma-json-schema-generator, an amazing work by Valentin Palkovic!

Getting Started

1. Install

npm:

npm install prisma-mongo-json-schema-generator --save-dev

yarn:

yarn add -D prisma-mongo-json-schema-generator

2. Apply the schema to database

PRISMA_SCHEMA_FILE=prisma/prisma.schema MONGO_URI=mongodb://localhost:27017/your-database yarn prisma-mongo-json-schema-generator-apply

Env variables:

Env name Default value
MONGO_URI required
PRISMA_SCHEMA_FILE prisma/prisma.schema
VALIDATION_LEVEL strict
VALIDATION_ACTION error

3. Validate collections according to the schema

PRISMA_SCHEMA_FILE=prisma/prisma.schema MONGO_URI=mongodb://localhost:27017/your-database yarn prisma-mongo-json-schema-generator-validate

Package Sidebar

Install

npm i prisma-mongo-json-schema-generator

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

25.6 kB

Total Files

27

Last publish

Collaborators

  • dimaip