mongo-auto-type-gen
v0.1.9
Published
Generate TypeScript types from MongoDB collections by inference
Readme
mongo-auto-type-gen
This is a usefull tool, that introspects your mongo collections and uses samples from them to generate types/interfaces/classes from them.
Usage
Generate TypeScript types from MongoDB collections by inference.
Command
mongots
Examples
mongots --uri mongodb://localhost:27017 --out ./generatedmongots --env-file .env --out ./generated
Flags
--uri <string>MongoDB connection URI--out <path>Output TypeScript file path (required)--sample <int>Sample size per collection (default: 15)--optional-threshold <float>Field required threshold (default: 0.98)--date-as <string>string|Date(default:string)--objectid-as <string>string|ObjectId(default:string)--config <path>Optional config path (yaml/json)--env-file <path>Path to .env file (optional)
Environment variables
MONGOTS_MONGO_URIorMONGO_URIMONGOTS_OUTMONGOTS_SAMPLEMONGOTS_OPTIONAL_THRESHOLDMONGOTS_DATE_ASMONGOTS_OBJECTID_AS
