Skip to content

Error when ref to subdocment #34

@qamalyanaren

Description

@qamalyanaren

{
.....
country: { type: mongoose.Schema.Types.ObjectId, ref: 'Countries', required: true },
city: { type: mongoose.Schema.Types.ObjectId, ref: 'Countries.cities' }
.....
}

Validation failed: city: Schema hasn't been registered for model "Countries.cities".\nUse mongoose.model(name, schema)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions