mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
respect limit of 1000 ops in bulk operation with mongojs 1.x
This commit is contained in:
parent
c7b4062412
commit
d3583b4ef6
1 changed files with 2 additions and 2 deletions
|
@ -331,8 +331,8 @@ module.exports = PackManager =
|
|||
expect_nRemoved = packObj.pack.length
|
||||
logger.log {doc_id: doc_id}, "adding pack, removing #{expect_nRemoved} ops"
|
||||
bulk.insert packObj
|
||||
packObj.pack.forEach (op) ->
|
||||
bulk.find({_id:op._id}).removeOne()
|
||||
ids = (op._id for op in packObj.pack)
|
||||
bulk.find({_id:{$in:ids}}).remove()
|
||||
bulk.execute (err, result) ->
|
||||
if err?
|
||||
logger.error {doc_id: doc_id}, "error adding pack"
|
||||
|
|
Loading…
Reference in a new issue