// protected methods protected override BulkWriteBatchResult EmulateSingleRequest(MongoConnection connection, WriteRequest request, int originalIndex) { var serverInstance = connection.ServerInstance; var updateRequest = (UpdateRequest)request; var updateRequests = new[] { updateRequest }; var operationArgs = new BulkUpdateOperationArgs( _args.CheckElementNames, _args.CollectionName, _args.DatabaseName, 1, // maxBatchCount serverInstance.MaxMessageLength, // maxBatchLength serverInstance.MaxDocumentSize, serverInstance.MaxWireDocumentSize, true, // isOrdered _args.ReaderSettings, updateRequests, _args.WriteConcern, _args.WriterSettings); var operation = new UpdateOpcodeOperation(operationArgs); WriteConcernResult writeConcernResult; WriteConcernException writeConcernException = null; try { writeConcernResult = operation.Execute(connection); } catch (WriteConcernException ex) { writeConcernResult = ex.WriteConcernResult; writeConcernException = ex; } var indexMap = new IndexMap.RangeBased(0, originalIndex, 1); return(BulkWriteBatchResult.Create( updateRequest, writeConcernResult, writeConcernException, indexMap)); }
// protected methods protected override BulkWriteBatchResult EmulateSingleRequest(MongoConnection connection, WriteRequest request, int originalIndex) { var serverInstance = connection.ServerInstance; var updateRequest = (UpdateRequest)request; var updateRequests = new[] { updateRequest }; var operationArgs = new BulkUpdateOperationArgs( _args.CheckElementNames, _args.CollectionName, _args.DatabaseName, 1, // maxBatchCount serverInstance.MaxMessageLength, // maxBatchLength serverInstance.MaxDocumentSize, serverInstance.MaxWireDocumentSize, true, // isOrdered _args.ReaderSettings, updateRequests, _args.WriteConcern, _args.WriterSettings); var operation = new UpdateOpcodeOperation(operationArgs); WriteConcernResult writeConcernResult; WriteConcernException writeConcernException = null; try { writeConcernResult = operation.Execute(connection); } catch (WriteConcernException ex) { writeConcernResult = ex.WriteConcernResult; writeConcernException = ex; } var indexMap = new IndexMap.RangeBased(0, originalIndex, 1); return BulkWriteBatchResult.Create( updateRequest, writeConcernResult, writeConcernException, indexMap); }
// constructors public BulkUpdateOperation(BulkUpdateOperationArgs args) : base(args) { _args = args; }
// constructors public UpdateBatchSerializer(BulkUpdateOperationArgs args) : base(args) { _args = args; }
// constructors public UpdateOpcodeOperationEmulator(BulkUpdateOperationArgs args) { _args = args; }
// constructors public UpdateOpcodeOperation(BulkUpdateOperationArgs args) : base(args.DatabaseName, args.CollectionName, args.ReaderSettings, args.WriterSettings, args.WriteConcern) { _args = args; }
// constructors public BulkUpdateOperationEmulator(BulkUpdateOperationArgs args) : base(args) { _args = args; }
// constructors public UpdateBatchSerializer(BulkUpdateOperationArgs args) : base(args) { _args = args; }
// constructors public UpdateOpcodeOperation(BulkUpdateOperationArgs args) : base(args.DatabaseName, args.CollectionName, args.ReaderSettings, args.WriterSettings, args.WriteConcern) { _args = args; }
// constructors public UpdateOpcodeOperationEmulator(BulkUpdateOperationArgs args) { _args = args; }