Log inSign up
News · #news

Derive TypeScript Types from Mongoose Schemas ?

When working with Mongoose and TypeScript, two helper types make your life much easier:
⛶/**
* Extracts the “plain” shape of your schema—
* just the fields you defined, without Mongoose’s built-in methods or `_id`.
*/
export type User = InferSchemaTypetypeof userSchema;

/**
* ...

? https://www.roastdev.com/post/derive-typescript-types-from-mongoose-schemas

#news #tech

0

Comments (0)

Log in to like, comment and share

Log in Sign up

    Related posts