Possibility of doing an upsert with BulkWriteAsync

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.0.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Is it possible to perform an upsert when doing a BulkWriteAsync operation with UpdateOneModel requests?

      For instance:

      List<UpdateOneModel<BsonDocument>> updateStatements = new List<UpdateOneModel<BsonDocument>>();
      
      // Cannot set UpdateOptions object here to configure the udpdate to run as an upsert
      updateStatements.Add(new UpdateOneModel<FactData>(filter, update));
      
      var result = await db.GetCollection<BsonDocument>("test").BulkWriteAsync(updateStatements);
      

            Assignee:
            Unassigned
            Reporter:
            Peter Gordon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: