If I created a change stream with _match stage to filter streams based on certain document with certain _id, it works fine with POST requests, but if I needed to update certain properties for a document with PATCH request the stream not fired.
Expected Behavior
Change stream message to be received if a change occur using a PATCH request on the filtered document.
Current Behavior
Change stream message NOT received if a change occur using a PATCH request on the filtered document.
Context
If I depend on POST requests to make a change on a document, the Change Event of the change stream will not contain any updateDescription information as in case of POST request the operationType is replace not update,
that is why I have to use PATCH because it's actually make a real update not replace, but in that case, the filtered stream will not fire.
Environment
Steps to Reproduce
Create a stream with the following info
{ "streams" : [ { "stages" : [ { "_$match" : { "fullDocument::_id" : { "_$var" : "n" } } } ], "uri" : "changestream" } , { "stages" : [], "uri" : "changestream2" } ] }
using any tool like firecamp to test your streams using WebSokets and start to listen for changes on a certain document like the following
ws://username:pass@server/db/collection/_streams/changestream?avars={'n': ObjectId("5ddf5e4e29f485c946fde3a4")}
make any PATCH request for document the same document above 5ddf5e4e29f485c946fde3a4
If I created a change stream with _match stage to filter streams based on certain document with certain _id, it works fine with POST requests, but if I needed to update certain properties for a document with PATCH request the stream not fired.
Expected Behavior
Change stream message to be received if a change occur using a PATCH request on the filtered document.
Current Behavior
Change stream message NOT received if a change occur using a PATCH request on the filtered document.
Context
If I depend on POST requests to make a change on a document, the Change Event of the change stream will not contain any updateDescription information as in case of POST request the operationType is replace not update, that is why I have to use PATCH because it's actually make a real update not replace, but in that case, the filtered stream will not fire.
Environment
Steps to Reproduce
{ "streams" : [ { "stages" : [ { "_$match" : { "fullDocument::_id" : { "_$var" : "n" } } } ], "uri" : "changestream" } , { "stages" : [], "uri" : "changestream2" } ] }
ws://username:pass@server/db/collection/_streams/changestream?avars={'n': ObjectId("5ddf5e4e29f485c946fde3a4")}
Possible Implementation