get method
Executes the query on the server and returns the nearest documents, nearest first.
The returned future fails with a FirestoreException: with code
unavailable when the client is offline, with failedPrecondition when
the instance was terminated, and with the code of any other error of the
backend. It is not retried.
Implementation
Future<VectorQuerySnapshot<T>> get() async {
final List<Document> docs = await query.firestore.client.runVectorQuery(
query.query,
this,
);
return VectorQuerySnapshotInternal.create<T>(
this,
docs
.map(
(Document doc) => QueryDocumentSnapshotInternal.fromDocument<T>(
query.firestore,
doc,
fromCache: false,
hasPendingWrites: false,
converter: query.converter,
),
)
.toList(growable: false),
);
}