Class VectorQuery (7.6.0)

A query that finds the documents whose vector fields are closest to a certain query vector. Create an instance of VectorQuery with Query.findNearest().

Package

@google-cloud/firestore

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the VectorQuery class.

Properties

query

get query(): Query<AppModelType, DbModelType>;

The query whose results participants in the vector search. Filtering performed by the query will apply before the vector search.

Methods

get()

get(): Promise<VectorQuerySnapshot<AppModelType, DbModelType>>;

Executes this vector search query.

Returns
TypeDescription
Promise<VectorQuerySnapshot<AppModelType, DbModelType>>

A promise that will be resolved with the results of the query.

isEqual(other)

isEqual(other: firestore.VectorQuery<AppModelType, DbModelType>): boolean;

Compares this object with the given object for equality.

This object is considered "equal" to the other object if and only if other performs the same vector distance search as this VectorQuery and the underlying Query of other compares equal to that of this object using Query.isEqual().

Parameter
NameDescription
other FirebaseFirestore.VectorQuery<AppModelType, DbModelType>

The object to compare to this object for equality.

Returns
TypeDescription
boolean

true if this object is "equal" to the given object, as defined above, or false otherwise.