--TEST-- MongoDB\Driver\Manager::executeBulkWrite() write concern error --SKIPIF-- --FILE-- insert(array('_id' => 1, 'x' => 1)); try { $manager->executeBulkWrite(NS, $bulk, new MongoDB\Driver\WriteConcern(30)); } catch (MongoDB\Driver\Exception\BulkWriteException $e) { printf("BulkWriteException: %s\n", $e->getMessage()); echo "\n===> WriteResult\n"; printWriteResult($e->getWriteResult()); } echo "\n===> Collection\n"; $cursor = $manager->executeQuery(NS, new MongoDB\Driver\Query(array())); var_dump(iterator_to_array($cursor)); ?> ===DONE=== --EXPECTF-- BulkWriteException: Not enough data-bearing nodes ===> WriteResult server: %s:%d insertedCount: 1 matchedCount: 0 modifiedCount: 0 upsertedCount: 0 deletedCount: 0 object(MongoDB\Driver\WriteConcernError)#%d (%d) { ["message"]=> string(29) "Not enough data-bearing nodes" ["code"]=> int(100) ["info"]=> %a } writeConcernError.message: Not enough data-bearing nodes writeConcernError.code: 100 writeConcernError.info: %a ===> Collection array(1) { [0]=> object(stdClass)#%d (%d) { ["_id"]=> int(1) ["x"]=> int(1) } } ===DONE===