[SERVER-40461] WriteResult._id is undefined in case of upsert Created: 03/Apr/19 Updated: 29/Oct/23 Resolved: 26/Apr/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 4.0.6 |
| Fix Version/s: | 4.1.11 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bruce Lucas (Inactive) | Assignee: | Gabriel Russell (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Dev Tools 2019-05-06, Dev Tools 2019-04-22 |
| Participants: |
| Description |
|
The WriteResult from an upsert displays in the shell like so:
However attempting to access the _id returns undefined:
The returned _id can be accessed as res.getUpsertedId()._id, but the value printed for res and the documentation indicate that it should be available as res._id. |
| Comments |
| Comment by Githook User [ 24/Apr/19 ] |
|
Author: {'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}Message: |
| Comment by Githook User [ 24/Apr/19 ] |
|
Author: {'email': 'gabriel.russell@mongodb.com', 'name': 'Gabriel Russell', 'username': 'gabrielrussell'}Message: |