docs-devsite/firestore_.vectorvalue.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Represents a vector type in Firestore documents. Create an instance with <code>vector()</code>.
<b>Signature:</b>
export declare class VectorValue
| Method | Modifiers | Description |
|---|---|---|
| fromJSON(json) | <code>static</code> | Builds a <code>VectorValue</code> instance from a JSON object created by VectorValue.toJSON()<!-- -->. |
| isEqual(other) | Returns <code>true</code> if the two <code>VectorValue</code> values have the same raw number arrays, returns <code>false</code> otherwise. | |
| toArray() | Returns a copy of the raw number array form of the vector. | |
| toJSON() | Returns a JSON-serializable representation of this <code>VectorValue</code> instance. |
Builds a VectorValue instance from a JSON object created by VectorValue.toJSON()<!-- -->.
<b>Signature:</b>
static fromJSON(json: object): VectorValue;
| Parameter | Type | Description |
|---|---|---|
| json | object | a JSON object represention of a <code>VectorValue</code> instance. |
<b>Returns:</b>
an instance of VectorValue if the JSON object could be parsed. Throws a FirestoreError if an error occurs.
Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise.
<b>Signature:</b>
isEqual(other: VectorValue): boolean;
| Parameter | Type | Description |
|---|---|---|
| other | VectorValue |
<b>Returns:</b>
boolean
Returns a copy of the raw number array form of the vector.
<b>Signature:</b>
toArray(): number[];
<b>Returns:</b>
number[]
Returns a JSON-serializable representation of this VectorValue instance.
<b>Signature:</b>
toJSON(): object;
<b>Returns:</b>
object
a JSON representation of this object.