@@ -110,6 +110,31 @@ background_mongoc_collection_aggregate (void *data)
110
110
return NULL ;
111
111
}
112
112
113
+ static void *
114
+ background_mongoc_collection_count (void * data )
115
+ {
116
+ future_t * future = (future_t * ) data ;
117
+ future_value_t return_value ;
118
+
119
+ return_value .type = future_value_int64_t_type ;
120
+
121
+ future_value_set_int64_t (
122
+ & return_value ,
123
+ mongoc_collection_count (
124
+ future_value_get_mongoc_collection_ptr (future_get_param (future , 0 )),
125
+ future_value_get_mongoc_query_flags_t (future_get_param (future , 1 )),
126
+ future_value_get_const_bson_ptr (future_get_param (future , 2 )),
127
+ future_value_get_int64_t (future_get_param (future , 3 )),
128
+ future_value_get_int64_t (future_get_param (future , 4 )),
129
+ future_value_get_const_mongoc_read_prefs_ptr (future_get_param (future , 5 )),
130
+ future_value_get_bson_error_ptr (future_get_param (future , 6 ))
131
+ ));
132
+
133
+ future_resolve (future , return_value );
134
+
135
+ return NULL ;
136
+ }
137
+
113
138
static void *
114
139
background_mongoc_collection_find_and_modify_with_opts (void * data )
115
140
{
@@ -478,6 +503,44 @@ future_collection_aggregate (
478
503
return future ;
479
504
}
480
505
506
+ future_t *
507
+ future_collection_count (
508
+ mongoc_collection_ptr collection ,
509
+ mongoc_query_flags_t flags ,
510
+ const_bson_ptr query ,
511
+ int64_t skip ,
512
+ int64_t limit ,
513
+ const_mongoc_read_prefs_ptr read_prefs ,
514
+ bson_error_ptr error )
515
+ {
516
+ future_t * future = future_new (future_value_int64_t_type ,
517
+ 7 );
518
+
519
+ future_value_set_mongoc_collection_ptr (
520
+ future_get_param (future , 0 ), collection );
521
+
522
+ future_value_set_mongoc_query_flags_t (
523
+ future_get_param (future , 1 ), flags );
524
+
525
+ future_value_set_const_bson_ptr (
526
+ future_get_param (future , 2 ), query );
527
+
528
+ future_value_set_int64_t (
529
+ future_get_param (future , 3 ), skip );
530
+
531
+ future_value_set_int64_t (
532
+ future_get_param (future , 4 ), limit );
533
+
534
+ future_value_set_const_mongoc_read_prefs_ptr (
535
+ future_get_param (future , 5 ), read_prefs );
536
+
537
+ future_value_set_bson_error_ptr (
538
+ future_get_param (future , 6 ), error );
539
+
540
+ future_start (future , background_mongoc_collection_count );
541
+ return future ;
542
+ }
543
+
481
544
future_t *
482
545
future_collection_find_and_modify_with_opts (
483
546
mongoc_collection_ptr collection ,
0 commit comments