Skip to content

UserSchema is missing "_id" #1

Open
@spratap124

Description

@spratap124

UserSchema is missing "_id" key thus it is throwing error while creating the new user.

please modify the UserSchema like below:

    var UserSchema = new Schema({
  _id:{
    type:String
  },
  email: {
    type: String, required: true,
    trim: true, unique: true,
    match: /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/
  },
  firstName: {type: String},
  lastName: {type: String}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions