Skip to content

Nested array of subdocuments #100

@walame

Description

@walame

Hello,

If I have an array of nested documents in my model, how would you go about implementing the controller and its validation? And how would you pass the data to Postman?

Here is what my model looks like:

const LeadSchema = new mongoose.Schema(
  {
    name: {
      type: String,
      required: true
    },
.
.
.
contacts: [
      {
        firstName: {
          type: String,
        },
        lastName: {
          type: String,
        },
        title: {
          type: String,
        }
        }
      }
    ]
.
.
.

Thank you very much!

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