realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.47k stars 1.75k forks source link

Add support for watching change streams to MongoCollection #6912

Closed RealmBot closed 4 years ago

RealmBot commented 4 years ago

Add support for watch operations on collections.

We should support the original watch API in a similar way to how we ported the MongoClient API's (i.e. replacing Task with RealmAsyncResultTask).

The original stitch API's are described here: http://stitch-sdks.s3-website-us-east-1.amazonaws.com/stitch-sdks/java/4/com/mongodb/stitch/android/services/mongodb/remote/RemoteMongoCollection.html

watch()
watch​(BsonValue... ids)
watch​(ObjectId... ids)
watchWithFilter​(BsonDocument matchFilter)
watchWithFilter​(Document matchFilter)

From a quick glance, it looks like we need to port the following classes:

RealmBot commented 4 years ago

➤ Clemente Tort Barbero commented:

We need some changes in the object store to support this functionality