* DivergentArrayError constructor. * @param {Array } paths * @api private
(paths)
| 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 | |
| 30 | Object.defineProperty(DivergentArrayError.prototype, 'name', { |
nothing calls this directly
no outgoing calls
no test coverage detected