[COMPASS-7023] Investigate changes in NODE-5186: Remove duplicate BulkWriteResult accessors Created: 14/Jul/23  Updated: 29/Oct/23  Resolved: 18/Aug/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Investigation Priority: Major - P3
Reporter: PM Bot Assignee: Anna Henningsen
Resolution: Fixed Votes: 0
Labels: node-driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on NODE-5186 Remove duplicate BulkWriteResult acce... Closed
Documented
Related
is related to MONGOSH-1507 Property 'result' is private and only... Closed
Epic Link: MONGOSH-1319
Documentation Changes: Needed
Documentation Changes Summary:

The documentation in https://www.mongodb.com/docs/manual/reference/method/Bulk.execute/ needs to account for the fact that the BulkWriteResult returned from mongosh does not match the actual result:

  • upserted is not present on bulk write results in mongosh (neither 1.x nor 2.x)
  • upsertedIds used to be an array in 1.x, is now a map from document index to ObjectId in mongosh 2.x
  • insertedIds follows the same format as upsertedIds now does (in both 1.x and 2.x)
Sprint: Iteration Iguanodon

 Description   

This ticket is a follow up for NODE-4791 to remove BulkWriteResult getters that were deprecated in NODE V5/V6

AC

  • Remove BulkWriteResult#nInserted
  • Remove BulkWriteResult#nUpserted
  • Remove BulkWriteResult#nMatched
  • Remove BulkWriteResult#nModified
  • Remove BulkWriteResult#nRemoved
  • Remove BulkWriteResult#getInsertedIds
  • Remove BulkWriteResult#getUpsertedIds
  • Add defaultValue documentation to BulkOptions


 Comments   
Comment by Githook User [ 06/Sep/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: feature/MONGOSH-1346
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 04/Sep/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: js-rules
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 04/Sep/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: remove-lerna-ci
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 01/Sep/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: main
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 28/Aug/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: 1541-dev
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 24/Aug/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: fix/MONGOSH-1317
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 18/Aug/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: feature/MONGOSH-1538
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 18/Aug/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023 (#1594)

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: MONGOSH-1319-shell-v2.0
https://github.com/mongodb-js/mongosh/commit/b158f9710edabedf8bdb82007c0e54c03853fd67

Comment by Githook User [ 17/Aug/23 ]

Author:

{'name': 'Anna Henningsen', 'email': 'anna.henningsen@mongodb.com', 'username': 'addaleax'}

Message: fix(shell-api): use public BulkWriteResult props MONGOSH-1507 COMPASS-7023

This accounts for removal of these legacy getters in the 6.x driver.

The only catch here is that `.result.upserted` is of a different type
than `.upsertedIds`, but since the type of the latter matches what our
own `BulkWriteResult` class expects (and also matches `.insertedIds`),
this is probably closer to a bug fix than proper breakage.
Branch: 1507-dev
https://github.com/mongodb-js/mongosh/commit/e9370c792495b5c5f1cf7e4b5aec93c84cca7502

Generated at Wed Feb 07 22:45:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.