firebase:: firestore:: SetOptions
#include <set_options.h>
An options object that configures the behavior of Set() calls.
Summary
By providing the SetOptions objects returned by Merge(), the Set() methods in DocumentReference, WriteBatch and Transaction can be configured to perform granular merges instead of overwriting the target documents in their entirety.
Constructors and Destructors |
|
---|---|
SetOptions()
Creates SetOptions with overwrite semantics.
|
|
SetOptions(const SetOptions & other)
Copy constructor.
|
|
SetOptions(SetOptions && other)
Move constructor.
|
|
~SetOptions()
|
Public types |
|
---|---|
Type{
|
enum The enumeration of all types of SetOptions. |
Public functions |
|
---|---|
operator=(const SetOptions & other)=default
|
Copy assignment operator.
|
operator=(SetOptions && other)=default
|
Move assignment operator.
|
Public static functions |
|
---|---|
Merge()
|
Returns an instance that can be used to change the behavior of Set() calls to only replace the values specified in its data argument.
|
MergeFieldPaths(const std::vector< FieldPath > & fields)
|
Returns an instance that can be used to change the behavior of Set() calls to only replace the given fields.
|
MergeFields(const std::vector< std::string > & fields)
|
Returns an instance that can be used to change the behavior of Set() calls to only replace the given fields.
|
Public types
Type
Type
The enumeration of all types of SetOptions.
Public functions
SetOptions
SetOptions( const SetOptions & other )=default
Copy constructor.
This performs a deep copy, creating an independent instance.
Details | |||
---|---|---|---|
Parameters |
|
SetOptions
SetOptions( SetOptions && other )=default
Move constructor.
Moving is more efficient than copying for SetOptions
. After being moved from, SetOptions
is in a valid but unspecified state.
Details | |||
---|---|---|---|
Parameters |
|
operator=
SetOptions & operator=( const SetOptions & other )=default
Copy assignment operator.
This performs a deep copy, creating an independent instance.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Reference to the destination
SetOptions . |
operator=
SetOptions & operator=( SetOptions && other )=default
Move assignment operator.
Moving is more efficient than copying for SetOptions
. After being moved from, SetOptions
is in a valid but unspecified state.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Reference to the destination
SetOptions . |
~SetOptions
~SetOptions()
Public static functions
Merge
SetOptions Merge()
Returns an instance that can be used to change the behavior of Set() calls to only replace the values specified in its data argument.
Fields omitted from the Set() call will remain untouched.
MergeFieldPaths
SetOptions MergeFieldPaths( const std::vector< FieldPath > & fields )
Returns an instance that can be used to change the behavior of Set() calls to only replace the given fields.
Any field that is not specified in fields
is ignored and remains untouched.
It is an error to pass a SetOptions object to a Set() call that is missing a value for any of the fields specified here in its to data argument.
Details | |||
---|---|---|---|
Parameters |
|
MergeFields
SetOptions MergeFields( const std::vector< std::string > & fields )
Returns an instance that can be used to change the behavior of Set() calls to only replace the given fields.
Any field that is not specified in fields
is ignored and remains untouched.
It is an error to pass a SetOptions object to a Set() call that is missing a value for any of the fields specified here.
Details | |||
---|---|---|---|
Parameters |
|