Skip to content

Commit 2881dda

Browse files
committed
fix: clean up some leftover issues with #8343
1 parent 146c33f commit 2881dda

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lib/options/SchemaDocumentArrayOptions.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const opts = require('./propertyOptions');
2222
/**
2323
* If `true`, Mongoose will skip building any indexes defined in this array's schema.
2424
* If not set, Mongoose will build all indexes defined in this array's schema.
25-
*
25+
*
2626
* ####Example:
27-
*
27+
*
2828
* const childSchema = Schema({ name: { type: String, index: true } });
2929
* // If `excludeIndexes` is `true`, Mongoose will skip building an index
3030
* // on `arr.name`. Otherwise, Mongoose will build an index on `arr.name`.
@@ -45,4 +45,4 @@ Object.defineProperty(SchemaDocumentArrayOptions.prototype, 'excludeIndexes', op
4545
* ignore
4646
*/
4747

48-
module.exports = SchemaArrayOptions;
48+
module.exports = SchemaDocumentArrayOptions;

lib/schema/documentarray.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
const ArrayType = require('./array');
88
const CastError = require('../error/cast');
99
const EventEmitter = require('events').EventEmitter;
10+
const SchemaDocumentArrayOptions =
11+
require('../options/SchemaDocumentArrayOptions');
1012
const SchemaType = require('../schematype');
1113
const discriminator = require('../helpers/model/discriminator');
1214
const get = require('../helpers/get');
@@ -91,6 +93,7 @@ DocumentArrayPath.options = { castNonArrays: true };
9193
*/
9294
DocumentArrayPath.prototype = Object.create(ArrayType.prototype);
9395
DocumentArrayPath.prototype.constructor = DocumentArrayPath;
96+
DocumentArrayPath.prototype.OptionsConstructor = SchemaDocumentArrayOptions;
9497

9598
/*!
9699
* Ignore

test/model.indexes.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('model', function() {
112112
});
113113
const otherSchema = Schema({
114114
name: { type: String, index: true }
115-
}, { excludeIndexes: true })
115+
}, { excludeIndexes: true });
116116

117117
const User = new Schema({
118118
name: {type: String, index: true},

0 commit comments

Comments
 (0)