@@ -90,6 +90,9 @@ _mongoc_gridfs_new (mongoc_client_t *client,
90
90
bson_error_t * error )
91
91
{
92
92
mongoc_gridfs_t * gridfs ;
93
+ const mongoc_read_prefs_t * read_prefs ;
94
+ const mongoc_read_concern_t * read_concern ;
95
+ const mongoc_write_concern_t * write_concern ;
93
96
char buf [128 ];
94
97
bool r ;
95
98
@@ -117,11 +120,17 @@ _mongoc_gridfs_new (mongoc_client_t *client,
117
120
118
121
gridfs -> client = client ;
119
122
123
+ read_prefs = mongoc_client_get_read_prefs (client );
124
+ read_concern = mongoc_client_get_read_concern (client );
125
+ write_concern = mongoc_client_get_write_concern (client );
126
+
120
127
bson_snprintf (buf , sizeof (buf ), "%s.chunks" , prefix );
121
- gridfs -> chunks = _mongoc_collection_new (client , db , buf , NULL , NULL , NULL );
128
+ gridfs -> chunks = _mongoc_collection_new (client , db , buf , read_prefs ,
129
+ read_concern , write_concern );
122
130
123
131
bson_snprintf (buf , sizeof (buf ), "%s.files" , prefix );
124
- gridfs -> files = _mongoc_collection_new (client , db , buf , NULL , NULL , NULL );
132
+ gridfs -> files = _mongoc_collection_new (client , db , buf , read_prefs ,
133
+ read_concern , write_concern );
125
134
126
135
r = _mongoc_gridfs_ensure_index (gridfs , error );
127
136
0 commit comments