vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Question: should editing document trigger change stream event?

Open hasyee opened this issue 1 year ago • 1 comments

If I edit (Edit Document) and save (Cmd + S) a document from the playground result, it does not trigger any change stream event at all: nor update or replace event. How does the editor update the documents? Is there any special option on this to ignore change stream events? However if I use a mongosh command on the same document from the playground (eg .updateOne(...)) it works as expected: an update event is generated.

Additional context

VSCode: 1.91.1 Platform: MacOS Darwin arm64 23.5.0 MongoDB for VS Code: 1.7.0

hasyee avatar Aug 22 '24 11:08 hasyee

Hi @hasyee When editing a document and saving, we run findOneAndReplace Here's where it is in the code: https://github.com/mongodb-js/vscode/blob/f99da1ffdf486c6c5a29c3d7c7e0fc6db652f9fd/src/editors/mongoDBDocumentService.ts#L93

Which MongoDB version are you on? Testing this myself I see a operationType: 'replace', event when saving.

Apologies for the late reply.

Anemy avatar Oct 07 '24 21:10 Anemy