Skip to content

Commit cbdd47d

Browse files
committed
CDRIVER-703 update mongoc_collection_get_last_error doc
1 parent 90c72a8 commit cbdd47d

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

doc/mongoc_collection_get_last_error.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mongoc_collection_get_last_error (const mongoc_collection_t *collection);
2626

2727
<section id="description">
2828
<title>Description</title>
29-
<p>The mongoc_collection_get_last_error() function shall return getLastError document, according to write_concern on last executed command for current collection instance.</p>
29+
<p>The mongoc_collection_get_last_error() function returns a bulk result. See <link xref="bulk">Bulk Write Operations</link> for examples of bulk results.</p>
3030
<p>A write_concern must be at least <code>MONGOC_WRITE_CONCERN_W_DEFAULT</code> in last command execution for this to be available.</p>
3131
</section>
3232

doc/mongoc_collection_insert.page

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ mongoc_collection_insert (mongoc_collection_t *collection,
3535
<section id="description">
3636
<title>Description</title>
3737
<p>This function shall insert <code>document</code> into <code>collection</code>.</p>
38-
<p>If no <code>_id</code> element is found in <code>document</code>, then a <code xref="bson:bson_oid_t">bson_oid_t</code> will be generated locally and added to the document.</p>
39-
<p>You can retrieve a generated <code>_id</code> from <code xref="mongoc_collection_get_last_error">mongoc_collection_get_last_error()</code>.</p>
38+
<p>If no <code>_id</code> element is found in <code>document</code>, then a <code xref="bson:bson_oid_t">bson_oid_t</code> will be generated locally and added to the document. If you must know the inserted document's <code>_id</code>, generate it in your code and include it as the first field of <code>document</code>. The <code>_id</code> you generate can be a <code xref="bson:bson_oid_t">bson_oid_t</code> or any other non-array BSON type.</p>
4039
</section>
4140

4241
<section id="errors">

src/mongoc/mongoc-collection.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,8 +2014,7 @@ mongoc_collection_get_name (mongoc_collection_t *collection)
20142014
*
20152015
* mongoc_collection_get_last_error --
20162016
*
2017-
* Returns getLastError document, according to write_concern on last
2018-
* executed command for current collection instance.
2017+
* Returns a bulk result.
20192018
*
20202019
* Returns:
20212020
* NULL or a bson_t that should not be modified or freed. This value

tests/test-mongoc-collection.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,6 @@ _test_legacy_bulk_insert (const bson_t **bsons,
819819
gle = mongoc_collection_get_last_error (collection);
820820
assert (gle);
821821

822-
/* TODO: should contain inserted ids, CDRIVER-703 */
823822
ASSERT_MATCH (gle, gle_json_formatted);
824823

825824
future_destroy (future);

0 commit comments

Comments
 (0)