Mongoose not saving child document Mongoose not saving child document mongoose mongoose

Mongoose not saving child document


Okay, so what I needed to do was change child to type like so:

name: { child: PersonName.schema }

to

name: { type: PersonName.schema }

By passing a schema, this also creates an _id, so I was able to change that by instead of passing a schema, just pass an object like so:

name { type: { first: String, last: String } }