Watch for changes in documents that match a specific criteria

Hi @John_Parsons

arrgh, sniped by @Aasawari (happily with a code example) my pipeline is slightly different.

A pipeline would need to be added to the watch.

Something like:

[ 
  { "$match": 
    { "operationType": "update", 
     "fullDocument.available": true,
     "fullDocument.language": "english",
     "updateDescription.updatedFields.location": { "$exists": true } 
    } 
  }
]

This would strictly match updates where the field location is updated along with the matching criteria for available and language.

If you want to also catch other scenarios like a new matching document being inserted the the pipeline would need further modification.