@@ -119,8 +119,12 @@ mongoc_bulk_operation_remove (mongoc_bulk_operation_t *bulk, /* IN */
119
119
bson_return_if_fail (bulk );
120
120
bson_return_if_fail (selector );
121
121
122
+ ENTRY ;
123
+
122
124
_mongoc_write_command_init_delete (& command , selector , true, bulk -> ordered );
123
125
_mongoc_array_append_val (& bulk -> commands , command );
126
+
127
+ EXIT ;
124
128
}
125
129
126
130
@@ -133,24 +137,36 @@ mongoc_bulk_operation_remove_one (mongoc_bulk_operation_t *bulk, /* IN */
133
137
bson_return_if_fail (bulk );
134
138
bson_return_if_fail (selector );
135
139
140
+ ENTRY ;
141
+
136
142
_mongoc_write_command_init_delete (& command , selector , false, bulk -> ordered );
137
143
_mongoc_array_append_val (& bulk -> commands , command );
144
+
145
+ EXIT ;
138
146
}
139
147
140
148
141
149
void
142
150
mongoc_bulk_operation_delete (mongoc_bulk_operation_t * bulk ,
143
151
const bson_t * selector )
144
152
{
153
+ ENTRY ;
154
+
145
155
mongoc_bulk_operation_remove (bulk , selector );
156
+
157
+ EXIT ;
146
158
}
147
159
148
160
149
161
void
150
162
mongoc_bulk_operation_delete_one (mongoc_bulk_operation_t * bulk ,
151
163
const bson_t * selector )
152
164
{
165
+ ENTRY ;
166
+
153
167
mongoc_bulk_operation_remove_one (bulk , selector );
168
+
169
+ EXIT ;
154
170
}
155
171
156
172
@@ -198,18 +214,23 @@ mongoc_bulk_operation_replace_one (mongoc_bulk_operation_t *bulk,
198
214
bson_return_if_fail (selector );
199
215
bson_return_if_fail (document );
200
216
217
+ ENTRY ;
218
+
201
219
if (!bson_validate (document ,
202
220
(BSON_VALIDATE_DOT_KEYS | BSON_VALIDATE_DOLLAR_KEYS ),
203
221
& err_off )) {
204
222
MONGOC_WARNING ("%s(): replacement document may not contain "
205
223
"$ or . in keys. Ingoring document." ,
206
224
__FUNCTION__ );
225
+ EXIT ;
207
226
return ;
208
227
}
209
228
210
229
_mongoc_write_command_init_update (& command , selector , document , upsert ,
211
230
false, bulk -> ordered );
212
231
_mongoc_array_append_val (& bulk -> commands , command );
232
+
233
+ EXIT ;
213
234
}
214
235
215
236
@@ -226,11 +247,14 @@ mongoc_bulk_operation_update (mongoc_bulk_operation_t *bulk,
226
247
bson_return_if_fail (selector );
227
248
bson_return_if_fail (document );
228
249
250
+ ENTRY ;
251
+
229
252
if (bson_iter_init (& iter , document )) {
230
253
while (bson_iter_next (& iter )) {
231
254
if (!strchr (bson_iter_key (& iter ), '$' )) {
232
255
MONGOC_WARNING ("%s(): update only works with $ operators." ,
233
256
__FUNCTION__ );
257
+ EXIT ;
234
258
return ;
235
259
}
236
260
}
@@ -239,6 +263,7 @@ mongoc_bulk_operation_update (mongoc_bulk_operation_t *bulk,
239
263
_mongoc_write_command_init_update (& command , selector , document , upsert ,
240
264
true, bulk -> ordered );
241
265
_mongoc_array_append_val (& bulk -> commands , command );
266
+ EXIT ;
242
267
}
243
268
244
269
@@ -255,11 +280,14 @@ mongoc_bulk_operation_update_one (mongoc_bulk_operation_t *bulk,
255
280
bson_return_if_fail (selector );
256
281
bson_return_if_fail (document );
257
282
283
+ ENTRY ;
284
+
258
285
if (bson_iter_init (& iter , document )) {
259
286
while (bson_iter_next (& iter )) {
260
287
if (!strchr (bson_iter_key (& iter ), '$' )) {
261
288
MONGOC_WARNING ("%s(): update_one only works with $ operators." ,
262
289
__FUNCTION__ );
290
+ EXIT ;
263
291
return ;
264
292
}
265
293
}
@@ -268,6 +296,7 @@ mongoc_bulk_operation_update_one (mongoc_bulk_operation_t *bulk,
268
296
_mongoc_write_command_init_update (& command , selector , document , upsert ,
269
297
false, bulk -> ordered );
270
298
_mongoc_array_append_val (& bulk -> commands , command );
299
+ EXIT ;
271
300
}
272
301
273
302
@@ -303,21 +332,21 @@ mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk, /* IN */
303
332
MONGOC_ERROR_COMMAND_INVALID_ARG ,
304
333
"mongoc_bulk_operation_execute() requires a client "
305
334
"and one has not been set." );
306
- return false;
335
+ RETURN ( false) ;
307
336
} else if (!bulk -> database ) {
308
337
bson_set_error (error ,
309
338
MONGOC_ERROR_COMMAND ,
310
339
MONGOC_ERROR_COMMAND_INVALID_ARG ,
311
340
"mongoc_bulk_operation_execute() requires a database "
312
341
"and one has not been set." );
313
- return false;
342
+ RETURN ( false) ;
314
343
} else if (!bulk -> collection ) {
315
344
bson_set_error (error ,
316
345
MONGOC_ERROR_COMMAND ,
317
346
MONGOC_ERROR_COMMAND_INVALID_ARG ,
318
347
"mongoc_bulk_operation_execute() requires a collection "
319
348
"and one has not been set." );
320
- return false;
349
+ RETURN ( false) ;
321
350
}
322
351
323
352
if (reply ) {
0 commit comments