2

In MongoDB, there is a possibility to listen for changes in the collection, which allows creating real-time apps. I wonder if there any similar functionality in ArangoDB?

Community
  • 1
  • 1
artnikpro
  • 5,487
  • 4
  • 38
  • 40

3 Answers3

4

arangochair is a Node.js module that adds changefeed capability to ArangoDB and make it realtime push ready

https://github.com/baslr/arangochair

Tutorial

https://www.arangodb.com/2017/03/arangochair-tool-listening-changes-arangodb/

2

ArangoDB currently doesn't offer triggers.

One can use FOXX Queues to repeatively execute queries on the database, which then could add such an event to a triggered collection that the frontend can poll for changes.

dothebart
  • 5,972
  • 16
  • 40
1

I'd approach this another way: create a Foxx application to "own" or "wrap" the collection. By that I mean only the Foxx app is allowed to change data in the collection. Externally, you invoke actions on the Foxx app's controller to do all data manipulation.

Then, you can give your Foxx app also the task of doing what you were planning to do on your subscriber side. Do it inline if it's a small task, or decouple it a little by using the lifecycle hooks. If the task should be done asynchronously, use a Foxx queue.