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

Method constructor

lib/error/divergentArray.js:18–29  ·  view source on GitHub ↗
(paths)

Source from the content-addressed store, hash-verified

16class DivergentArrayError extends MongooseError {
17
18 constructor(paths) {
19 const msg = 'For your own good, using `document.save()` to update an array '
20 + 'which was selected using an $elemMatch or $slice projection OR '
21 + 'populated using skip, limit, query conditions, or exclusion of '
22 + 'the _id field when the operation results in a $pop or $set of '
23 + 'the entire array is not supported. The following '
24 + 'path(s) would have been modified unsafely:\n'
25 + ' ' + paths.join('\n ') + '\n'
26 + 'Use Model.updateOne() to update these arrays instead. '
27 + 'See https://mongoosejs.com/docs/faq.html#divergent-array-error for more information.';
28 super(msg);
29 }
30}
31
32Object.defineProperty(DivergentArrayError.prototype, 'name', {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected