firebase::firestore::FieldPath

#include <field_path.h>

AFieldPath refers to a field in a document.

Summary

The path may consist of a single field name (referring to a top level field in the document) or a list of field names (referring to a nested field in the document).

Constructors and Destructors

FieldPath()
Creates an invalidFieldPath that has to be reassigned before it can be used.
FieldPath(std::initializer_list< std::string > field_names)
Creates aFieldPath from the provided field names.
FieldPath(const std::vector< std::string > & field_names)
Creates aFieldPath from the provided field names.
FieldPath(constFieldPath & other)
Copy constructor.
FieldPath(FieldPath && other)
Move constructor.
~FieldPath()

Friend classes

operator<<
friend std::ostream &
Outputs the string representation of thisFieldPath to the given stream.
std::hash< FieldPath >
friend struct

Public functions

ToString() const
std::string
Returns a string representation of thisFieldPath for logging/debugging purposes.
is_valid() const
bool
Returns true if thisFieldPath is valid, false if it is not valid.
operator=(constFieldPath & other)
Copy assignment operator.
operator=(FieldPath && other) noexcept
Move assignment operator.

Public static functions

DocumentId()
A special sentinelFieldPath to refer to the ID of a document.

Friend classes

operator<<

friendstd::ostream&operator<<(std::ostream&out,constFieldPath&path)

Outputs the string representation of thisFieldPath to the given stream.

See also:ToString() for comments on the representation format.

std::hash< FieldPath >

friendstructstd::hash<FieldPath>

Public functions

FieldPath

FieldPath()

Creates an invalidFieldPath that has to be reassigned before it can be used.

Calling any member function on an invalidFieldPath will be a no-op. If the function returns a value, it will return a zero, empty, or invalid value, depending on the type of the value.

FieldPath

FieldPath(std::initializer_list<std::string>field_names)

Creates aFieldPath from the provided field names.

If more than one field name is provided, the path will point to a nested field in a document.

Details
Parameters
field_names
A list of field names.

FieldPath

FieldPath(conststd::vector<std::string>&field_names)

Creates aFieldPath from the provided field names.

If more than one field name is provided, the path will point to a nested field in a document.

Details
Parameters
field_names
A vector of field names.

FieldPath

FieldPath(constFieldPath&other)

Copy constructor.

This performs a deep copy, creating an independent instance.

Details
Parameters
other
FieldPath to copy from.

FieldPath

FieldPath(FieldPath&&other)noexcept

Move constructor.

Moving is more efficient than copying forFieldPath. After being moved from,FieldPath is in a valid but unspecified state.

Details
Parameters
other
FieldPath to move data from.

ToString

std::stringToString()const

is_valid

boolis_valid()const

Returns true if thisFieldPath is valid, false if it is not valid.

An invalidFieldPath could be the result of:

Details
Returns
true if thisFieldPath is valid, false if thisFieldPath is invalid.

operator=

FieldPath&operator=(constFieldPath&other)

Copy assignment operator.

This performs a deep copy, creating an independent instance.

Details
Parameters
other
FieldPath to copy from.
Returns
Reference to the destinationFieldPath.

operator=

FieldPath&operator=(FieldPath&&other)noexcept

Move assignment operator.

Moving is more efficient than copying forFieldPath. After being moved from,FieldPath is in a valid but unspecified state.

Details
Parameters
other
FieldPath to move data from.
Returns
Reference to the destinationFieldPath.

~FieldPath

~FieldPath()

Public static functions

DocumentId

FieldPathDocumentId()

A special sentinelFieldPath to refer to the ID of a document.

It can be used in queries to sort or filter by the document ID.

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 2024-01-23 UTC.