Is there any way to perform bulk updates on ReactiveMongo?

后端 未结 2 869
夕颜
夕颜 2021-01-23 18:14

Suppose I want to do the following (in mongo shell):

var bulk = db.vectors.initializeOrderedBulkOp()

bulk.find({\"_id\" : ObjectId(\"53f265da13d3f885ed8bf75d\")         


        
2条回答
  •  一生所求
    2021-01-23 18:23

    I am using reactive-mongo 0.11.9:

    import collection.BatchCommands._
    import UpdateCommand._ 
    import reactivemongo.bson._
    
    collection.runCommand(Update(
      UpdateElement(q = document(...), u = document(...)), 
      UpdateElement(q = document(...), u = document(...))...
    ))
    

提交回复
热议问题