[ Web Proxy ]
URL:
Viewing: https://firebase.google.com/docs/reference/js/firestore_.vectorvalue [Back]  [Original]

VectorValue class  |  Firebase JavaScript API reference Skip to main content
Overview Fundamentals AI Build Run Reference Samples
Firebase [Firebase]
Send feedback

VectorValue class Stay organized with collections Save and categorize content based on your preferences.

Represents a vector type in Firestore documents. Create an instance with vector().

Signature:

export declare class VectorValue 

Methods

Method Modifiers Description
fromJSON(json) static Builds a VectorValue instance from a JSON object created by VectorValue.toJSON().
isEqual(other) Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise.
toArray() Returns a copy of the raw number array form of the vector.
toJSON() Returns a JSON-serializable representation of this VectorValue instance.

VectorValue.fromJSON()

Builds a VectorValue instance from a JSON object created by VectorValue.toJSON().

Signature:

static fromJSON(json: object): VectorValue;

Parameters

Parameter Type Description
json object a JSON object represention of a VectorValue instance.

Returns:

VectorValue

an instance of VectorValue if the JSON object could be parsed. Throws a FirestoreError if an error occurs.

VectorValue.isEqual()

Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise.

Signature:

isEqual(other: VectorValue): boolean;

Parameters

Parameter Type Description
other VectorValue

Returns:

boolean

VectorValue.toArray()

Returns a copy of the raw number array form of the vector.

Signature:

toArray(): number[];

Returns:

number[]

VectorValue.toJSON()

Returns a JSON-serializable representation of this VectorValue instance.

Signature:

toJSON(): object;

Returns:

object

a JSON representation of this object.

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-15 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-01-15 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page