How to listen for changes to a MongoDB collection?

后端 未结 11 1610
不思量自难忘°
不思量自难忘° 2020-11-22 06:08

I\'m creating a sort of background job queue system with MongoDB as the data store. How can I \"listen\" for inserts to a MongoDB collection before spawning workers to proce

11条回答
  •  余生分开走
    2020-11-22 06:45

    After 3.6 one is allowed to use database the following database triggers types:

    • event-driven triggers - useful to update related documents automatically, notify downstream services, propagate data to support mixed workloads, data integrity & auditing
    • scheduled triggers - useful for scheduled data retrieval, propagation, archival and analytics workloads

    Log into your Atlas account and select Triggers interface and add new trigger:

    Expand each section for more settings or details.

提交回复
热议问题