Skip to content

Firestore Value

The Firestore Value structure represents a single typed value stored inside a Firestore Document. It is used as the fundamental building block for all Firestore data and can represent primitive values, arrays, and nested objects.

Firestore values are shared between C++ and Blueprint workflows. However, native factory and getter functions of this structure are intended for C++ usage only.

In Blueprint, Firestore values must be created and accessed using the Firestore Value Library.


Relationship with Firestore Document

FFirestoreValue is used as the value type for all fields stored in a FFirestoreDocument.

A Firestore Document is a map of field names to Firestore Values:

  • FFirestoreDocument — container of fields
  • FFirestoreValue — typed value stored in each field

These two structures are tightly coupled and always used together.


EFirestoreValueType

Defines the type of a Firestore value.

Name Description
None No value is set.
Int Integer value.
Bool Boolean value.
Double Double-precision floating-point value.
String UTF-8 string value.
Object Nested object represented as a map of values.
Array Array of Firestore values.
Null Explicit null value.

FFirestoreValue

This struct represents a single Firestore value with an associated type.


Fields

Field Type Description
Type EFirestoreValueType The type of the stored value.
IntValue int32 Stored integer value (when type is Int).
BoolValue bool Stored boolean value (when type is Bool).
DoubleValue double Stored double value (when type is Double).
StringValue FString Stored string value (when type is String).
ObjectValue TSharedPtr<TMap<FString, FFirestoreValue>> Stored object value (when type is Object).
ArrayValue TSharedPtr<TArray<FFirestoreValue>> Stored array value (when type is Array).

Factory Functions (C++ Only)

These functions create Firestore values of a specific type.
They are intended for C++ usage only.

Function Parameters Description
FromInt Value Creates an integer value.
FromBool Value Creates a boolean value.
FromDouble Value Creates a double value.
FromString Value Creates a string value.
FromObject Object Creates an object value from a map of fields.
FromArray Array Creates an array value.
FromNull Creates a null value.

Getters (C++ Only)

Function Returns Description
GetInt int32 Returns the integer value or 0 if the type does not match.
GetBool bool Returns the boolean value or false if the type does not match.
GetDouble double Returns the double value or 0.0 if the type does not match.
GetString FString Returns the string value or an empty string if the type does not match.
GetObject TMap<FString, FFirestoreValue> Returns the object value or an empty map if the type does not match.
GetArray TArray<FFirestoreValue> Returns the array value or an empty array if the type does not match.

Type Checks (C++ Only)

Function Returns Description
IsNull bool Returns true if the value is null.
IsObject bool Returns true if the value is an object.
IsArray bool Returns true if the value is an array.

Blueprint Access

In Blueprint, Firestore values are created and accessed exclusively through the Firestore Value Library. The Blueprint library operates on the same underlying data structure but exposes a safe and supported Blueprint interface.

C++ users may use either: - native FFirestoreValue factory and getter functions, or - Blueprint library wrappers for consistency across C++ and Blueprint code.