Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Streams with Amazon DocumentDB

I am setting up a microservice which needs to react on changes of a Amazon DocumentDB. When working with MongoDB I would use Reactive Change Streams for that. If I do this with the DocumentDB I get an exception when registering the change listener saying that the change streams are currently not supported.

2019-02-12T11:46:15.513+0100 E QUERY    [js] Error: command failed: {
    "ok" : 0,
    "errmsg" : "The $changeStream stage is currently not supported",
    "code" : 303
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:18:14
_assertCommandWorked@src/mongo/shell/assert.js:534:17
assert.commandWorked@src/mongo/shell/assert.js:618:16
DB.prototype._runAggregate@src/mongo/shell/db.js:260:9
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1062:12
DBCollection.prototype.watch@src/mongo/shell/collection.js:1589:12
@(shell):1:1

For the "old-style"-solution (op-log-tailing) I didn't find any hint on how to implement this.

What is the recommended setup to register to db changes on the Amazon DocumentDB?

like image 997
SebastianK Avatar asked Feb 12 '19 08:02

SebastianK


Video Answer


1 Answers

Amazon DocumentDB now supports change streams: https://aws.amazon.com/about-aws/whats-new/2019/10/amazon-documentdb-with-mongodb-compatibility-adds-support-for-change-streams/

like image 157
Joseph Idziorek Avatar answered Sep 27 '22 20:09

Joseph Idziorek