Skip to content

Schema hasn't been registered for model #61

@mayconsilvaa

Description

@mayconsilvaa

Hi! Good morning.

I am getting the following error when working with ref.

Schema hasn't been registered for model "User". Use mongoose.model(name, schema)

--

const { ObjectId } = use('mongoose').Schema.Types

leaderId: {
type: ObjectId,
ref: 'User',
required: true,
}

Thank you to help!

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