get method

Future<QuerySnapshot<T>> get(
  1. [GetOptions? options]
)

Fetches the documents matching the query.

Parameters:

  • options: Optional get options.

Returns: A Future that resolves to a QuerySnapshot.

Example:

var snapshot = await query.get();

Implementation

Future<QuerySnapshot<T>> get([GetOptions? options]) async {
  // needs to go to helper class
  FusabaseAuth auth = FusabaseAuth.instanceFor(app: this._oracledb.app);
  String? accessToken = await getAccessToken(auth);

  Map<String, dynamic> result;

  try {
    result = await _helper.get(
      createClient(_oracledb.app),
      options,
      this,
      this.__logLevel,
      accessToken,
      null,
    );
  } catch (e) {
    return QuerySnapshot<T>(
      [],
      this,
      SnapshotMetadata(hasPendingWrites: false, isFromCache: false),
    );
  }

  return QuerySnapshot<T>(
    result["ret"] ?? [],
    this,
    SnapshotMetadata(hasPendingWrites: false, isFromCache: false),
  );
}