@@ -445,19 +445,19 @@ static PHP_METHOD(MongoDB_Driver_BulkWriteCommand, replaceOne)
445
445
char * ns ;
446
446
size_t ns_len ;
447
447
zval * zfilter ;
448
- zval * zupdate ;
449
- zval * zoptions = NULL ;
450
- bson_t bfilter = BSON_INITIALIZER ;
451
- bson_t bupdate = BSON_INITIALIZER ;
452
- mongoc_bulkwrite_replaceoneopts_t * opts = NULL ;
453
- bson_error_t error = { 0 };
448
+ zval * zreplacement ;
449
+ zval * zoptions = NULL ;
450
+ bson_t bfilter = BSON_INITIALIZER ;
451
+ bson_t breplacement = BSON_INITIALIZER ;
452
+ mongoc_bulkwrite_replaceoneopts_t * opts = NULL ;
453
+ bson_error_t error = { 0 };
454
454
455
455
intern = Z_BULKWRITECOMMAND_OBJ_P (getThis ());
456
456
457
457
PHONGO_PARSE_PARAMETERS_START (3 , 4 )
458
458
Z_PARAM_STRING (ns , ns_len )
459
459
Z_PARAM_ARRAY_OR_OBJECT (zfilter )
460
- Z_PARAM_ARRAY_OR_OBJECT (zupdate )
460
+ Z_PARAM_ARRAY_OR_OBJECT (zreplacement )
461
461
Z_PARAM_OPTIONAL
462
462
Z_PARAM_ARRAY_OR_NULL (zoptions )
463
463
PHONGO_PARSE_PARAMETERS_END ();
@@ -473,8 +473,7 @@ static PHP_METHOD(MongoDB_Driver_BulkWriteCommand, replaceOne)
473
473
goto cleanup ;
474
474
}
475
475
476
- // Explicitly allow MongoDB\BSON\PackedArray for update pipelines
477
- php_phongo_zval_to_bson (zupdate , PHONGO_BSON_ALLOW_ROOT_ARRAY , & bupdate , NULL );
476
+ php_phongo_zval_to_bson (zreplacement , PHONGO_BSON_NONE , & breplacement , NULL );
478
477
479
478
if (EG (exception )) {
480
479
goto cleanup ;
@@ -524,7 +523,7 @@ static PHP_METHOD(MongoDB_Driver_BulkWriteCommand, replaceOne)
524
523
}
525
524
}
526
525
527
- if (!mongoc_bulkwrite_append_replaceone (intern -> bw , ns , & bfilter , & bupdate , opts , & error )) {
526
+ if (!mongoc_bulkwrite_append_replaceone (intern -> bw , ns , & bfilter , & breplacement , opts , & error )) {
528
527
phongo_throw_exception_from_bson_error_t (& error );
529
528
goto cleanup ;
530
529
}
@@ -533,7 +532,7 @@ static PHP_METHOD(MongoDB_Driver_BulkWriteCommand, replaceOne)
533
532
534
533
cleanup :
535
534
bson_destroy (& bfilter );
536
- bson_destroy (& bupdate );
535
+ bson_destroy (& breplacement );
537
536
mongoc_bulkwrite_replaceoneopts_destroy (opts );
538
537
}
539
538
0 commit comments