arashsheyda / nuxt-mongoose

A Nuxt module for simplifying the use of Mongoose in your project.
https://docs.arashsheyda.me/nuxt-mongoose
76 stars 14 forks source link

feat: add possibility to type mongoose model #8

Closed oumarbarry closed 1 year ago

oumarbarry commented 1 year ago

This way, we can do:

interface Movie {
  title: string
  description: string
}

export const Movie = defineMongooseModel<Movie>('Movie', {
  title: { type: String, required: true },
  description: String
})
Giorno-Giovana commented 1 year ago

+1, just wanted to create the same pull request