mongoose-tsgen
mongoose-tsgen copied to clipboard
A plug-n-play Typescript generator for Mongoose.
I'm using `tsc-alias` for alias path in my express application, and when i tried to run `mtgen command`. it gives this error: ``` Generating mongoose typescript definitions... ! Error: Cannot...
Hey! Back again after a while with something. I'm using the latest version of the module (9.0.5). **The desired structure** Before I show the Schema, I think it's easier to...
Here's a failing snippet: ```js import mongoose from 'mongoose'; import { TestDocument, TestModel, TestSchema, } from '../interfaces/mongoose.gen'; const { Schema } = mongoose; const booleanGroupSchema = new Schema( { editSignature:...
Using `LeanDocument["_id"]` throws type error This code: ``` const messageRule = await MessageRule.findById(...).lean(); const listingID = messageRule.listingID; const listingsIDs = await Listing.find({ $or: [{_id: listingID}, {linkedListingID: listingID}] }).distinct("_id"); ``` throws...
I would like to use mongoose-tsgen from within another script, and so, I'd like to expose a method that performs the same actions the cli would. I called the method...
We have a plugin for soft deletes through which we add some utils on each schema. The types show up with any when generated using mtgen. thoughts?
is there a way to get exactly what throws? ``` TypeError: Cannot read properties of undefined (reading 'ASSET') error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation...
Hello! I am having issues trying to create a new Document in ts (it works fine in js). `"mongoose": "^5.11.10",` `"mongoose-tsgen": "7.1.3",` `node: v16.15.1` `npm: v8.11.0` `tsc: Version 4.9.3` Schema...
I was having trouble of not being able to generate the types due to using absolute path imports with `baseUrl` in the `tsconfig.json`.  Upon checking, apparently, the ts-parser does...
In order to handle Dates where we don't care about the time, we have a custom schema type of `DateOnly` that is effectively a wrapper around `Date` with some validators...