findRecord method

Future<SdbRecordSnapshot<K, V>?> findRecord(
  1. SdbClient client, {
  2. SdbBoundaries<K>? boundaries,
  3. SdbFilter? filter,
  4. int? offset,
  5. bool? descending,
  6. SdbFindOptions<K>? options,
})

Find first records

Implementation

Future<SdbRecordSnapshot<K, V>?> findRecord(
  SdbClient client, {

  SdbBoundaries<K>? boundaries,

  /// Optional filter, performed in memory
  SdbFilter? filter,
  int? offset,

  /// Optional sort order
  bool? descending,

  /// New API, supercedes the other parameters
  SdbFindOptions<K>? options,
}) async {
  options = sdbFindOptionsMerge(
    options,
    boundaries: boundaries,
    offset: offset,
    descending: descending,
    filter: filter,
  );
  options = options.copyWith(limit: 1);
  var records = await findRecords(client, options: options);
  return records.firstOrNull;
}