Reference documentation and code samples for the Cloud Firestore V1 Client class Target.
A specification of a set of documents to listen to.
Generated from protobuf message google.firestore.v1.Target
Namespace
Google \ Cloud \ Firestore \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ query
↳ documents
↳ resume_token
string
A resume token from a prior TargetChange for an identical target. Using a resume token with a different target is unsupported and may fail.
↳ read_time
Google\Protobuf\Timestamp
Start listening after a specific read_time
. The client must know the state of matching documents at this time.
↳ target_id
int
The target ID that identifies the target on the stream. Must be a positive number and non-zero. If target_id
is 0 (or unspecified), the server will assign an ID for this target and return that in a TargetChange::ADD
event. Once a target with target_id=0
is added, all subsequent targets must also have target_id=0
. If an AddTarget
request with target_id != 0
is sent to the server after a target with target_id=0
is added, the server will immediately send a response with a TargetChange::Remove
event. Note that if the client sends multiple AddTarget
requests without an ID, the order of IDs returned in TargetChage.target_ids
are undefined. Therefore, clients should provide a target ID instead of relying on the server to assign one. If target_id
is non-zero, there must not be an existing active target on this stream with the same ID.
↳ once
bool
If the target should be removed once it is current and consistent.
↳ expected_count
Google\Protobuf\Int32Value
The number of documents that last matched the query at the resume token or read time. This value is only relevant when a resume_type
is provided. This value being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names
to be included in the response.
getQuery
A target specified by a query.
hasQuery
setQuery
A target specified by a query.
$this
getDocuments
A target specified by a set of document names.
hasDocuments
setDocuments
A target specified by a set of document names.
$this
getResumeToken
A resume token from a prior TargetChange for an identical target.
Using a resume token with a different target is unsupported and may fail.
string
hasResumeToken
setResumeToken
A resume token from a prior TargetChange for an identical target.
Using a resume token with a different target is unsupported and may fail.
var
string
$this
getReadTime
Start listening after a specific read_time
.
The client must know the state of matching documents at this time.
hasReadTime
setReadTime
Start listening after a specific read_time
.
The client must know the state of matching documents at this time.
$this
getTargetId
The target ID that identifies the target on the stream. Must be a positive number and non-zero.
If target_id
is 0 (or unspecified), the server will assign an ID for this
target and return that in a TargetChange::ADD
event. Once a target with target_id=0
is added, all subsequent targets must also have target_id=0
. If an AddTarget
request with target_id != 0
is
sent to the server after a target with target_id=0
is added, the server
will immediately send a response with a TargetChange::Remove
event.
Note that if the client sends multiple AddTarget
requests
without an ID, the order of IDs returned in TargetChage.target_ids
are
undefined. Therefore, clients should provide a target ID instead of relying
on the server to assign one.
If target_id
is non-zero, there must not be an existing active target on
this stream with the same ID.
int
setTargetId
The target ID that identifies the target on the stream. Must be a positive number and non-zero.
If target_id
is 0 (or unspecified), the server will assign an ID for this
target and return that in a TargetChange::ADD
event. Once a target with target_id=0
is added, all subsequent targets must also have target_id=0
. If an AddTarget
request with target_id != 0
is
sent to the server after a target with target_id=0
is added, the server
will immediately send a response with a TargetChange::Remove
event.
Note that if the client sends multiple AddTarget
requests
without an ID, the order of IDs returned in TargetChage.target_ids
are
undefined. Therefore, clients should provide a target ID instead of relying
on the server to assign one.
If target_id
is non-zero, there must not be an existing active target on
this stream with the same ID.
var
int
$this
getOnce
If the target should be removed once it is current and consistent.
bool
setOnce
If the target should be removed once it is current and consistent.
var
bool
$this
getExpectedCount
The number of documents that last matched the query at the resume token or read time.
This value is only relevant when a resume_type
is provided. This value
being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names
to be included in the response.
hasExpectedCount
clearExpectedCount
getExpectedCountValue
Returns the unboxed value from getExpectedCount()
The number of documents that last matched the query at the resume token or
read time.
This value is only relevant when a resume_type
is provided. This value
being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names
to be included in the response.
int|null
setExpectedCount
The number of documents that last matched the query at the resume token or read time.
This value is only relevant when a resume_type
is provided. This value
being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names
to be included in the response.
$this
setExpectedCountValue
Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.
The number of documents that last matched the query at the resume token or
read time.
This value is only relevant when a resume_type
is provided. This value
being present and greater than zero signals that the client wants ExistenceFilter.unchanged_names
to be included in the response.
var
int|null
$this
getTargetType
string
getResumeType
string