Skip to content

Commit

Permalink
docs(schema): add Schema#paths docs to public API docs
Browse files Browse the repository at this point in the history
Fix #8340
  • Loading branch information
vkarpov15 committed Nov 16, 2019
1 parent 10bb6ed commit a821c30
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,17 @@ Object.defineProperty(Schema.prototype, 'childSchemas', {
Schema.prototype.obj;

/**
* Schema as flat paths
* 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:
* {
* '_id' : SchemaType,
* , 'nested.key' : SchemaType,
* }
* const schema = new Schema({ name: String }, { _id: false });
* schema.paths; // { name: SchemaString { ... } }
*
* schema.add({ age: Number });
* schema.paths; // { name: SchemaString { ... }, age: SchemaNumber { ... } }
*
* @api private
* @api public
* @property paths
* @memberOf Schema
* @instance
Expand Down

0 comments on commit a821c30

Please sign in to comment.