@@ -492,60 +492,60 @@ bool phongo_split_namespace(char *namespace, char **dbname, char **cname) /* {{{
492
492
return true;
493
493
} /* }}} */
494
494
495
- mongoc_bulk_operation_t * phongo_writebatch_init (zend_bool ordered ) { /* {{{ */
495
+ mongoc_bulk_operation_t * phongo_bulkwrite_init (zend_bool ordered ) { /* {{{ */
496
496
return mongoc_bulk_operation_new (ordered );
497
497
} /* }}} */
498
498
499
499
int phongo_execute_single_insert (mongoc_client_t * client , char * namespace , bson_t * doc , mongoc_write_concern_t * write_concern , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
500
500
{
501
501
bool retval = false;
502
- mongoc_bulk_operation_t * batch ;
502
+ mongoc_bulk_operation_t * bulk ;
503
503
504
- batch = phongo_writebatch_init (true);
505
- mongoc_bulk_operation_insert (batch , doc );
504
+ bulk = phongo_bulkwrite_init (true);
505
+ mongoc_bulk_operation_insert (bulk , doc );
506
506
507
- retval = phongo_execute_write (client , namespace , batch , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
508
- mongoc_bulk_operation_destroy (batch );
507
+ retval = phongo_execute_write (client , namespace , bulk , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
508
+ mongoc_bulk_operation_destroy (bulk );
509
509
510
510
return retval ;
511
511
} /* }}} */
512
512
513
513
int phongo_execute_single_update (mongoc_client_t * client , char * namespace , bson_t * query , bson_t * update , mongoc_write_concern_t * write_concern , mongoc_update_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
514
514
{
515
515
bool retval = false;
516
- mongoc_bulk_operation_t * batch ;
516
+ mongoc_bulk_operation_t * bulk ;
517
517
518
- batch = phongo_writebatch_init (true);
518
+ bulk = phongo_bulkwrite_init (true);
519
519
if (flags & MONGOC_UPDATE_MULTI_UPDATE ) {
520
- mongoc_bulk_operation_update_one (batch , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
520
+ mongoc_bulk_operation_update_one (bulk , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
521
521
} else {
522
- mongoc_bulk_operation_update (batch , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
522
+ mongoc_bulk_operation_update (bulk , query , update , !!(flags & MONGOC_UPDATE_UPSERT ));
523
523
}
524
- retval = phongo_execute_write (client , namespace , batch , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
525
- mongoc_bulk_operation_destroy (batch );
524
+ retval = phongo_execute_write (client , namespace , bulk , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
525
+ mongoc_bulk_operation_destroy (bulk );
526
526
527
527
return retval ;
528
528
} /* }}} */
529
529
530
530
int phongo_execute_single_delete (mongoc_client_t * client , char * namespace , bson_t * query , mongoc_write_concern_t * write_concern , mongoc_delete_flags_t flags , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
531
531
{
532
532
bool retval = false;
533
- mongoc_bulk_operation_t * batch ;
533
+ mongoc_bulk_operation_t * bulk ;
534
534
535
- batch = phongo_writebatch_init (true);
535
+ bulk = phongo_bulkwrite_init (true);
536
536
if (flags & MONGOC_DELETE_SINGLE_REMOVE ) {
537
- mongoc_bulk_operation_remove_one (batch , query );
537
+ mongoc_bulk_operation_remove_one (bulk , query );
538
538
} else {
539
- mongoc_bulk_operation_remove (batch , query );
539
+ mongoc_bulk_operation_remove (bulk , query );
540
540
}
541
541
542
- retval = phongo_execute_write (client , namespace , batch , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
543
- mongoc_bulk_operation_destroy (batch );
542
+ retval = phongo_execute_write (client , namespace , bulk , write_concern , 0 , return_value , return_value_used TSRMLS_CC );
543
+ mongoc_bulk_operation_destroy (bulk );
544
544
545
545
return retval ;
546
546
} /* }}} */
547
547
548
- bool phongo_execute_write (mongoc_client_t * client , char * namespace , mongoc_bulk_operation_t * batch , mongoc_write_concern_t * write_concern , int server_hint , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
548
+ bool phongo_execute_write (mongoc_client_t * client , char * namespace , mongoc_bulk_operation_t * bulk , mongoc_write_concern_t * write_concern , int server_hint , zval * return_value , int return_value_used TSRMLS_DC ) /* {{{ */
549
549
{
550
550
bson_error_t error ;
551
551
bson_t reply ;
@@ -558,18 +558,18 @@ bool phongo_execute_write(mongoc_client_t *client, char *namespace, mongoc_bulk_
558
558
return false;
559
559
}
560
560
561
- mongoc_bulk_operation_set_database (batch , dbname );
562
- mongoc_bulk_operation_set_collection (batch , collname );
563
- mongoc_bulk_operation_set_client (batch , client );
564
- mongoc_bulk_operation_set_write_concern (batch , write_concern );
561
+ mongoc_bulk_operation_set_database (bulk , dbname );
562
+ mongoc_bulk_operation_set_collection (bulk , collname );
563
+ mongoc_bulk_operation_set_client (bulk , client );
564
+ mongoc_bulk_operation_set_write_concern (bulk , write_concern );
565
565
efree (dbname );
566
566
efree (collname );
567
567
568
568
if (server_hint ) {
569
- mongoc_bulk_operation_set_hint (batch , server_hint );
569
+ mongoc_bulk_operation_set_hint (bulk , server_hint );
570
570
}
571
571
572
- hint = mongoc_bulk_operation_execute (batch , & reply , & error );
572
+ hint = mongoc_bulk_operation_execute (bulk , & reply , & error );
573
573
574
574
/* If there is no error then the command succeeded, but the write not */
575
575
if (!hint && (error .code || error .domain )) {
@@ -1608,7 +1608,7 @@ PHP_MINIT_FUNCTION(phongo)
1608
1608
PHP_MINIT (ReadPreference )(INIT_FUNC_ARGS_PASSTHRU );
1609
1609
PHP_MINIT (Result )(INIT_FUNC_ARGS_PASSTHRU );
1610
1610
PHP_MINIT (Server )(INIT_FUNC_ARGS_PASSTHRU );
1611
- PHP_MINIT (WriteBatch )(INIT_FUNC_ARGS_PASSTHRU );
1611
+ PHP_MINIT (BulkWrite )(INIT_FUNC_ARGS_PASSTHRU );
1612
1612
PHP_MINIT (WriteConcern )(INIT_FUNC_ARGS_PASSTHRU );
1613
1613
PHP_MINIT (WriteConcernError )(INIT_FUNC_ARGS_PASSTHRU );
1614
1614
PHP_MINIT (WriteError )(INIT_FUNC_ARGS_PASSTHRU );
0 commit comments