Specifies what type of distance is calculated when performing the query.
distanceResultField
distanceResultField?:string|firestore.FieldPath;
Optionally specifies the name of a field that will be set on each returned DocumentSnapshot, which will contain the computed distance for the document.
distanceThreshold
distanceThreshold?:number;
Specifies a threshold for which no less similar documents will be returned. The behavior of the specifieddistanceMeasurewill affect the meaning of the distance threshold.
FordistanceMeasure: "EUCLIDEAN", the meaning ofdistanceThresholdis: SELECT docs WHERE euclidean_distance <= distanceThreshold - FordistanceMeasure: "COSINE", the meaning ofdistanceThresholdis: SELECT docs WHERE cosine_distance <= distanceThreshold - FordistanceMeasure: "DOT_PRODUCT", the meaning ofdistanceThresholdis: SELECT docs WHERE dot_product_distance >= distanceThreshold
limit
limit:number;
Specifies the upper bound of documents to return, must be a positive integer with a maximum value of 1000.
queryVector
queryVector:firestore.VectorValue|Array<number>;
TheVectorValueused to measure the distance fromvectorFieldvalues in the documents.
vectorField
vectorField:string|firestore.FieldPath;
A string orFieldPathspecifying the vector field to search on.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Interface VectorQueryOptions (7.11.0)\n\nVersion latestkeyboard_arrow_down\n\n- [7.11.0 (latest)](/nodejs/docs/reference/firestore/latest/firestore/vectorqueryoptions)\n- [7.9.0](/nodejs/docs/reference/firestore/7.9.0/firestore/vectorqueryoptions)\n- [7.7.0](/nodejs/docs/reference/firestore/7.7.0/firestore/vectorqueryoptions)\n- [7.6.0](/nodejs/docs/reference/firestore/7.6.0/firestore/vectorqueryoptions)\n- [7.5.0](/nodejs/docs/reference/firestore/7.5.0/firestore/vectorqueryoptions)\n- [7.4.0](/nodejs/docs/reference/firestore/7.4.0/firestore/vectorqueryoptions)\n- [7.3.1](/nodejs/docs/reference/firestore/7.3.1/firestore/vectorqueryoptions)\n- [7.2.0](/nodejs/docs/reference/firestore/7.2.0/firestore/vectorqueryoptions)\n- [7.1.0](/nodejs/docs/reference/firestore/7.1.0/firestore/vectorqueryoptions)\n- [6.4.1](/nodejs/docs/reference/firestore/6.4.1/firestore/vectorqueryoptions)\n- [6.3.0](/nodejs/docs/reference/firestore/6.3.0/firestore/vectorqueryoptions)\n- [6.0.0](/nodejs/docs/reference/firestore/6.0.0/firestore/vectorqueryoptions)\n- [5.0.2](/nodejs/docs/reference/firestore/5.0.2/firestore/vectorqueryoptions)\n- [4.15.1](/nodejs/docs/reference/firestore/4.15.1/firestore/vectorqueryoptions)\n- [4.14.2](/nodejs/docs/reference/firestore/4.14.2/firestore/vectorqueryoptions)\n- [4.9.8](/nodejs/docs/reference/firestore/4.9.8/firestore/vectorqueryoptions) \nSpecifies the behavior of the [VectorQuery](/nodejs/docs/reference/firestore/latest/firestore/vectorquery) generated by a call to .\n\nPackage\n-------\n\n[@google-cloud/firestore](../overview.html)\n\nProperties\n----------\n\n### distanceMeasure\n\n distanceMeasure: 'EUCLIDEAN' | 'COSINE' | 'DOT_PRODUCT';\n\nSpecifies what type of distance is calculated when performing the query.\n\n### distanceResultField\n\n distanceResultField?: string | firestore.FieldPath;\n\nOptionally specifies the name of a field that will be set on each returned DocumentSnapshot, which will contain the computed distance for the document.\n\n### distanceThreshold\n\n distanceThreshold?: number;\n\nSpecifies a threshold for which no less similar documents will be returned. The behavior of the specified `distanceMeasure` will affect the meaning of the distance threshold.\n\n- For `distanceMeasure: \"EUCLIDEAN\"`, the meaning of `distanceThreshold` is: SELECT docs WHERE euclidean_distance \\\u003c= distanceThreshold - For `distanceMeasure: \"COSINE\"`, the meaning of `distanceThreshold` is: SELECT docs WHERE cosine_distance \\\u003c= distanceThreshold - For `distanceMeasure: \"DOT_PRODUCT\"`, the meaning of `distanceThreshold` is: SELECT docs WHERE dot_product_distance \\\u003e= distanceThreshold\n\n### limit\n\n limit: number;\n\nSpecifies the upper bound of documents to return, must be a positive integer with a maximum value of 1000.\n\n### queryVector\n\n queryVector: firestore.VectorValue | Array\u003cnumber\u003e;\n\nThe [VectorValue](/nodejs/docs/reference/firestore/latest/firestore/vectorvalue) used to measure the distance from `vectorField` values in the documents.\n\n### vectorField\n\n vectorField: string | firestore.FieldPath;\n\nA string or [FieldPath](/nodejs/docs/reference/firestore/latest/firestore/fieldpath) specifying the vector field to search on."]]