listInternal<T> method
Fetch list with given parameters. this method working over partitions. it can work slower since in this case you need internet connection Return result not included nested object / list
Implementation
Future<List<T>> listInternal<T>(String database,
{Map? filter, Map? sort}) async {
assert(_partition.length != 0);
Map<dynamic, dynamic> map = await _channel
.invokeMethod(Action.internalObjects.name, <String, dynamic>{
'database': database,
'collection': T.toString(),
'identity': _syncUser.identity,
'appId': _appId,
'partition': _partition,
'filter': filter,
'sort': sort,
'limit': _limit,
});
if (map["error"] != null) {
throw Exception("fetch list finished with exception ${map["error"]}");
}
List results = map["results"];
return results.map<T>((map) => _creator().fromJson(map) as T).toList();
}