Skip to content

Commit b0ac1c2

Browse files
author
Christian Hergert
committed
bulk: return the server hint from bulk execute.
1 parent 885085c commit b0ac1c2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

doc/mongoc_bulk_operation_execute.page

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<section id="synopsis">
1717
<title>Synopsis</title>
18-
<synopsis><code mime="text/x-csrc"><![CDATA[bool
18+
<synopsis><code mime="text/x-csrc"><![CDATA[uint32_t
1919
mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk,
2020
bson_t *reply,
2121
bson_error_t *error);
@@ -43,7 +43,7 @@ mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk,
4343

4444
<section id="return">
4545
<title>Returns</title>
46-
<p><code>true</code> on success, otherwise <code>false</code> and <code>error</code> is set.</p>
46+
<p>A non-zero <code>hint</code> of the peer node on success, otherwise <code>0</code> and <code>error</code> is set.</p>
4747
</section>
4848

4949

src/mongoc/mongoc-bulk-operation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ mongoc_bulk_operation_update_one (mongoc_bulk_operation_t *bulk,
270270
}
271271

272272

273-
bool
273+
uint32_t
274274
mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk, /* IN */
275275
bson_t *reply, /* OUT */
276276
bson_error_t *error) /* OUT */
@@ -349,7 +349,7 @@ mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk, /* IN */
349349
cleanup:
350350
ret = _mongoc_write_result_complete (&bulk->result, reply, error);
351351

352-
RETURN (ret);
352+
RETURN (ret ? hint : 0);
353353
}
354354

355355
void

src/mongoc/mongoc-bulk-operation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ typedef struct _mongoc_bulk_operation_t mongoc_bulk_operation_t;
3131

3232

3333
void mongoc_bulk_operation_destroy (mongoc_bulk_operation_t *bulk);
34-
bool mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk,
34+
uint32_t mongoc_bulk_operation_execute (mongoc_bulk_operation_t *bulk,
3535
bson_t *reply,
3636
bson_error_t *error);
3737
void mongoc_bulk_operation_delete (mongoc_bulk_operation_t *bulk,

0 commit comments

Comments
 (0)