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()
.
VectorValue
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
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.
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 2025-06-30 UTC.
[null,null,["Last updated 2025-06-30 UTC."],[],[],null,["Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2).\n\nVectorValue\n\n**Signature:** \n\n export declare class VectorValue \n\nMethods\n\nVectorValue.fromJSON()\n\nBuilds a `VectorValue` instance from a JSON object created by [VectorValue.toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson).\n\n**Signature:** \n\n static fromJSON(json: object): VectorValue;\n\nParameters\n\n**Returns:**\n\n[VectorValue](./firestore_lite.vectorvalue.md#vectorvalue_class)\n\nan instance of [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs.\n\nVectorValue.isEqual()\n\nReturns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.\n\n**Signature:** \n\n isEqual(other: VectorValue): boolean;\n\nParameters\n\n**Returns:**\n\nboolean\n\nVectorValue.toArray()\n\nReturns a copy of the raw number array form of the vector.\n\n**Signature:** \n\n toArray(): number[];\n\n**Returns:**\n\nnumber\\[\\]\n\nVectorValue.toJSON()\n\nReturns a JSON-serializable representation of this `VectorValue` instance.\n\n**Signature:** \n\n toJSON(): object;\n\n**Returns:**\n\nobject\n\na JSON representation of this object."]]