Uname: Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.213.251.212
Your Ip: 18.117.184.55
User: allssztx (535) | Group: allssztx (533)
Safe Mode: OFF
Disable Function:
NONE

name : divergentArray.js

/*!
 * Module dependencies.
 */

'use strict';

const MongooseError = require('./mongooseError');

/**
 * DivergentArrayError constructor.
 * @param {Array<String>} paths
 * @api private
 */

class DivergentArrayError extends MongooseError {

  constructor(paths) {
    const msg = 'For your own good, using `document.save()` to update an array '
            + 'which was selected using an $elemMatch projection OR '
            + 'populated using skip, limit, query conditions, or exclusion of '
            + 'the _id field when the operation results in a $pop or $set of '
            + 'the entire array is not supported. The following '
            + 'path(s) would have been modified unsafely:\n'
            + '  ' + paths.join('\n  ') + '\n'
            + 'Use Model.updateOne() to update these arrays instead.';
    // TODO write up a docs page (FAQ) and link to it
    super(msg);
  }
}

Object.defineProperty(DivergentArrayError.prototype, 'name', {
  value: 'DivergentArrayError'
});

/*!
 * exports
 */

module.exports = DivergentArrayError;
© 2025 GrazzMean-Shell