Firestore Value API Reference
This section documents the Blueprint helper functions used to create, inspect, and work with FFirestoreValue instances. These functions represent the only supported way to construct and read Firestore values in Blueprints.
FFirestoreValue is a low-level data container used by FFirestoreDocument to represent typed Firestore fields. The structure itself is shared between C++ and Blueprints, but Blueprint users must always use this library to create and access values.
All functions in this section operate locally and do not perform any Firestore network operations.
Value Creation
| Node | Parameters | Callbacks / Return | Description |
|---|---|---|---|
| Make Int | Value (int32) |
FFirestoreValue |
Creates a Firestore integer value. |
| Make Bool | Value (bool) |
FFirestoreValue |
Creates a Firestore boolean value. |
| Make Double | Value (double) |
FFirestoreValue |
Creates a Firestore double-precision numeric value. |
| Make String | Value (string) |
FFirestoreValue |
Creates a Firestore string value. |
| Make Object | Fields (map |
FFirestoreValue |
Creates a Firestore object value composed of key-value pairs. |
| Make Array | Array (array |
FFirestoreValue |
Creates a Firestore array value. |
| Make Null | – | FFirestoreValue |
Creates a Firestore null value. |
Value Getters
| Node | Parameters | Callbacks / Return | Description |
|---|---|---|---|
| Get Int | Value (FFirestoreValue) |
int32 |
Returns the integer stored in the Firestore value, or 0 if the type does not match. |
| Get Bool | Value (FFirestoreValue) |
bool |
Returns the boolean stored in the Firestore value, or false if the type does not match. |
| Get Double | Value (FFirestoreValue) |
double |
Returns the double value stored in the Firestore value, or 0.0 if the type does not match. |
| Get String | Value (FFirestoreValue) |
string |
Returns the string stored in the Firestore value, or an empty string if the type does not match. |
| Get Object | Value (FFirestoreValue) |
map<string, FFirestoreValue> |
Returns the object fields stored in the Firestore value, or an empty map if the type does not match. |
| Get Array | Value (FFirestoreValue) |
array<FFirestoreValue> |
Returns the array stored in the Firestore value, or an empty array if the type does not match. |
| Get Type | Value (FFirestoreValue) |
EFirestoreValueType |
Returns the type of the Firestore value. |
Notes
- Firestore values are strongly typed and must be created using the appropriate Make function.
- Type mismatches in getter functions return default values instead of causing errors.
- Firestore values are typically used as fields inside
FFirestoreDocument.
C++ Usage
In C++, FFirestoreValue can also be used in two different ways, depending on your workflow.
Using Native C++ API
When working purely in C++, you can directly construct and inspect FFirestoreValue using its native C++ interface. This approach is often more convenient and expressive when building complex objects or arrays in C++ code.
To use the native API, include the value header:
#include "FirestoreValue.h"
The following example demonstrates creating and reading Firestore values using the native C++ API:
FFirestoreValue LevelValue = FFirestoreValue::FromInt(5);
FFirestoreValue NameValue = FFirestoreValue::FromString(TEXT("player123"));
int32 Level = LevelValue.GetInt();
FString Name = NameValue.GetString();
Using Blueprint Helper Functions in C++
The same helper functions exposed to Blueprints can also be used from C++ by including the Blueprint helper library:
#include "FirestoreValueLibrary.h"
The following example demonstrates the same value creation and access pattern using the Blueprint helper functions from C++:
FFirestoreValue LevelValue = UFirestoreValueLibrary::MakeInt(5);
FFirestoreValue NameValue = UFirestoreValueLibrary::MakeString(TEXT("player123"));
int32 Level = UFirestoreValueLibrary::GetInt(LevelValue);
FString Name = UFirestoreValueLibrary::GetString(NameValue);
This approach is useful when:
- sharing logic between Blueprint and C++
- keeping behavior consistent across both systems
Summary
- Blueprint users must always use the Blueprint helper functions
- C++ users may choose either approach native
FFirestoreValueAPI or Blueprint helper functions viaFirestoreValueLibrary
Both approaches are fully supported and interoperable.