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

Method constructor

lib/error/divergentArray.js:16–27  ·  view source on GitHub ↗

* DivergentArrayError constructor. * @param {Array } paths * @api private

(paths)

Source from the content-addressed store, hash-verified

14 * @api private
15 */
16 constructor(paths) {
17 const msg = 'For your own good, using `document.save()` to update an array '
18 + 'which was selected using an $elemMatch projection OR '
19 + 'populated using skip, limit, query conditions, or exclusion of '
20 + 'the _id field when the operation results in a $pop or $set of '
21 + 'the entire array is not supported. The following '
22 + 'path(s) would have been modified unsafely:\n'
23 + ' ' + paths.join('\n ') + '\n'
24 + 'Use Model.updateOne() to update these arrays instead.';
25 // TODO write up a docs page (FAQ) and link to it
26 super(msg);
27 }
28}
29
30Object.defineProperty(DivergentArrayError.prototype, 'name', {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected