Schema.prototype.paths

Type:
  • «property»

The paths defined on this schema. The keys are the top-level paths in this schema, and the values are instances of the SchemaType class.

Example:

  1. const schema = new Schema({ name: String }, { _id: false });
  2. schema.paths; // { name: SchemaString { ... } }
  3. schema.add({ age: Number });
  4. schema.paths; // { name: SchemaString { ... }, age: SchemaNumber { ... } }