[DOCS-15240] [Server] Open change streams iteration example script returns error from mongosh session Created: 13/Apr/22 Updated: 13/Nov/23 Resolved: 07/Sep/23 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | mongosh, Server |
| Affects Version/s: | 5.0.6 |
| Fix Version/s: | 5.0.6, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113 |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Shane Smith | Assignee: | Lauren Tran |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | quick-win, server-docs-bug-bash | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Sample Environment: |
||
| Participants: | |
| Days since reply: | 21 weeks, 6 days ago |
| Description |
|
Summary: I found the example scripts listed in the below article to open a change stream are not compatible in a session using the mongosh binary. https://www.mongodb.com/docs/v5.0/reference/method/db.collection.watch/#examples The below error occurs when attempting to execute the cursor.IsExhausted() method on a change stream cursor opened within mongosh.
This script does work fine with the legacy mongo binary. As a workaround with mongosh, I used the isClosed() method instead in the while loop like below:
Wondering here if the docs should be updated to note incompatibility of cursor.isExhausted() against a change stream cursor from mongosh, and/or suggest an alternate example of iterating the change stream cursor with mongosh.
|
| Comments |
| Comment by Lauren Tran [ 07/Sep/23 ] |
|
Requested change has already been made |