-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 1.1.8
-
Component/s: None
-
None
The following parameters are rejected by libmongoc and no write is added to the bulk object; however, a debug log message is the only indication of failure.
Update document contains dotted keys but no dollar keys
<?php ini_set('mongodb.debug', 'stderr'); $b = new MongoDB\Driver\BulkWrite; $b->update(['x'=>1], ['y.x'=>1]); var_dump(count($b));
[2016-09-20T23:52:19+00:00] mongoc: TRACE > ENTRY: mongoc_bulk_operation_replace_one():246 [2016-09-20T23:52:19+00:00] mongoc: WARNING > mongoc_bulk_operation_replace_one(): replacement document may not contain $ or . in keys. Ignoring document. [2016-09-20T23:52:19+00:00] mongoc: TRACE > EXIT: mongoc_bulk_operation_replace_one():252 int(0)
Replacement document with multi=true
<?php ini_set('mongodb.debug', 'stderr'); $b = new MongoDB\Driver\BulkWrite; $b->update(['x'=>1], ['y'=>1], ['multi' => true]); var_dump(count($b));
[2016-09-20T23:59:04+00:00] mongoc: TRACE > ENTRY: mongoc_bulk_operation_update():288 [2016-09-20T23:59:04+00:00] mongoc: WARNING > mongoc_bulk_operation_update(): update only works with $ operators. [2016-09-20T23:59:04+00:00] mongoc: TRACE > EXIT: mongoc_bulk_operation_update():295 int(0)