MCPcopy Create free account
hub / github.com/Automattic/mongoose / DocumentArrayElement

Function DocumentArrayElement

lib/schema/DocumentArrayElement.js:21–31  ·  view source on GitHub ↗

* DocumentArrayElement SchemaType constructor. * * @param {String} path * @param {Object} options * @inherits SchemaType * @api public

(path, options)

Source from the content-addressed store, hash-verified

19 */
20
21function DocumentArrayElement(path, options) {
22 this.$parentSchemaType = options && options.$parentSchemaType;
23 if (!this.$parentSchemaType) {
24 throw new MongooseError('Cannot create DocumentArrayElement schematype without a parent');
25 }
26 delete options.$parentSchemaType;
27
28 SchemaType.call(this, path, options, 'DocumentArrayElement');
29
30 this.$isMongooseDocumentArrayElement = true;
31}
32
33/**
34 * This schema type's name, to defend against minifiers that mangle

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected