realm / realm-dart

Realm is a mobile database: a replacement for SQLite & ORMs.
Apache License 2.0
763 stars 87 forks source link

Changes Value on RealmObject returned by find method of DynamicRealm not implemented #1624

Open PINAJ024 opened 6 months ago

PINAJ024 commented 6 months ago

Problem - Flutter SDK

With the version of realm 2.0.0 for Flutter, we have a class called DynamicRealm, where we can execute a find method to get a RealmObject, but this object has an exception on changes value.

 RealmObject _retrieveDocument(Document id) {
    final RealmObject? object =
        _realm.dynamic.find(id.collectionId, id.documentId);
    if (object == null) {
      throw const ChassisException(message: 'Document can not be retrieved');
    }

    return object;
  }

  /// Access to changes causes an exception
  final Stream<RealmObjectChanges<RealmObjectBase>> stream = _retrieveDocument(id).changes;

image

Solution

Allow to developer to get access to changes value in order to listen to changes for a single RealmObject

Alternatives

No response

How important is this improvement for you?

Would be a major improvement

Feature would mainly be used with

Atlas App Services: Auth or Functions etc

sync-by-unito[bot] commented 6 months ago

➤ PM Bot commented:

Jira ticket: RDART-1001