VectorValue class Stay organized with collections Save and categorize content based on your preferences.
Represents a vector type in Firestore documents. Create an instance withvector().
Signature:
exportdeclareclassVectorValueMethods
| Method | Modifiers | Description |
|---|---|---|
| fromJSON(json) | static | Builds aVectorValue instance from a JSON object created byVectorValue.toJSON(). |
| isEqual(other) | Returnstrue if the twoVectorValue values have the same raw number arrays, returnsfalse otherwise. | |
| toArray() | Returns a copy of the raw number array form of the vector. | |
| toJSON() | Returns a JSON-serializable representation of thisVectorValue instance. |
VectorValue.fromJSON()
Builds aVectorValue instance from a JSON object created byVectorValue.toJSON().
Signature:
staticfromJSON(json:object):VectorValue;Parameters
| Parameter | Type | Description |
|---|---|---|
| json | object | a JSON object represention of aVectorValue instance. |
Returns:
an instance ofVectorValue if the JSON object could be parsed. Throws aFirestoreError if an error occurs.
VectorValue.isEqual()
Returnstrue if the twoVectorValue values have the same raw number arrays, returnsfalse 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 thisVectorValue instance.
Signature:
toJSON():object;Returns:
object
a JSON representation of this object.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-15 UTC.