Skip to content

Commit

Permalink
fix: clean up some leftover issues with #8343
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 18, 2019
1 parent 146c33f commit 2881dda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/options/SchemaDocumentArrayOptions.js
Expand Up @@ -22,9 +22,9 @@ const opts = require('./propertyOptions');
/**
* If `true`, Mongoose will skip building any indexes defined in this array's schema.
* If not set, Mongoose will build all indexes defined in this array's schema.
*
*
* ####Example:
*
*
* const childSchema = Schema({ name: { type: String, index: true } });
* // If `excludeIndexes` is `true`, Mongoose will skip building an index
* // on `arr.name`. Otherwise, Mongoose will build an index on `arr.name`.
Expand All @@ -45,4 +45,4 @@ Object.defineProperty(SchemaDocumentArrayOptions.prototype, 'excludeIndexes', op
* ignore
*/

module.exports = SchemaArrayOptions;
module.exports = SchemaDocumentArrayOptions;
3 changes: 3 additions & 0 deletions lib/schema/documentarray.js
Expand Up @@ -7,6 +7,8 @@
const ArrayType = require('./array');
const CastError = require('../error/cast');
const EventEmitter = require('events').EventEmitter;
const SchemaDocumentArrayOptions =
require('../options/SchemaDocumentArrayOptions');
const SchemaType = require('../schematype');
const discriminator = require('../helpers/model/discriminator');
const get = require('../helpers/get');
Expand Down Expand Up @@ -91,6 +93,7 @@ DocumentArrayPath.options = { castNonArrays: true };
*/
DocumentArrayPath.prototype = Object.create(ArrayType.prototype);
DocumentArrayPath.prototype.constructor = DocumentArrayPath;
DocumentArrayPath.prototype.OptionsConstructor = SchemaDocumentArrayOptions;

/*!
* Ignore
Expand Down
2 changes: 1 addition & 1 deletion test/model.indexes.test.js
Expand Up @@ -112,7 +112,7 @@ describe('model', function() {
});
const otherSchema = Schema({
name: { type: String, index: true }
}, { excludeIndexes: true })
}, { excludeIndexes: true });

const User = new Schema({
name: {type: String, index: true},
Expand Down

0 comments on commit 2881dda

Please sign in to comment.