Skip to content

Quick questions #46

Open
Open
@kamran-12

Description

@kamran-12

I have not used this plugin yet but I am planning to. My questions:

  1. 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?
  2. 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?
  3. 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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions