I have not used this plugin yet but I am planning to. My questions:
- If I put all my models into a single file and name it
models.ts, then put it directly into server folder, in place of models folder, will it work? Will it need any non-default configurations?
- I noticed
defineMongooseConnection and defineMongooseModel methods in readme.md but cannot find them in Mongoose documentation. Why? Are these exclusive to nuxt-mongoose? If so, what about regular Mongoose functionality? Do I need something else to import to access them or importing them from '#nuxt/mongoose' will be enough?
- In which folder/file do I put the following code?
import { defineMongooseConnection } from '#nuxt/mongoose'
export const connection = defineMongooseConnection('mongodb://127.0.0.1/nuxt-mongoose')
I have not used this plugin yet but I am planning to. My questions:
models.ts, then put it directly intoserverfolder, in place ofmodelsfolder, will it work? Will it need any non-default configurations?defineMongooseConnectionanddefineMongooseModelmethods inreadme.mdbut cannot find them in Mongoose documentation. Why? Are these exclusive to nuxt-mongoose? If so, what about regular Mongoose functionality? Do I need something else to import to access them or importing themfrom '#nuxt/mongoose'will be enough?