We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3cccc3 commit 62d5302Copy full SHA for 62d5302
lib/types/array/methods/index.js
@@ -374,7 +374,13 @@ const methods = {
374
if (val != null && utils.hasUserDefinedProperty(val, '$each')) {
375
atomics.$push = val;
376
} else {
377
- atomics.$push.$each.push(val);
+ if (val.length < 10000) {
378
+ atomics.$push.$each.push(...val);
379
+ } else {
380
+ for (const v of val) {
381
+ atomics.$push.$each.push(v);
382
+ }
383
384
}
385
386
atomics[op] = val;
@@ -711,7 +717,7 @@ const methods = {
711
717
'with different `$position`');
712
718
713
719
atomic = values;
714
- ret = [].push.apply(arr, values);
720
+ ret = _basePush.apply(arr, values);
715
721
716
722
723
this._registerAtomic('$push', atomic);
0 commit comments