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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the Google.Cloud.Firestore.V1.Target API is 3.10.0, with several prior versions available for use.\u003c/p\u003e\n"],["\u003cp\u003eThe Target class is a specification for listening to a set of documents, implementing interfaces like IMessage, IEquatable, IDeepCloneable, and IBufferMessage.\u003c/p\u003e\n"],["\u003cp\u003eA Target can be defined by specifying either a set of document names through \u003ccode\u003eDocuments\u003c/code\u003e or by using a query via \u003ccode\u003eQuery\u003c/code\u003e, and it supports target identification via the \u003ccode\u003eTargetId\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe Target class allows for the use of a \u003ccode\u003eResumeToken\u003c/code\u003e to continue listening from a previous point, and it can also be configured to stop listening once the target is consistent with the \u003ccode\u003eOnce\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe Target class gives access to properties such as ExpectedCount, which denotes the number of documents that matched the query at the time of the resume token, as well as the \u003ccode\u003eReadTime\u003c/code\u003e, for listening after a specific point.\u003c/p\u003e\n"]]],[],null,["# Firestore v1 API - Class Target (3.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.10.0 (latest)](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Target)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.9.0/Google.Cloud.Firestore.V1.Target)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.8.0/Google.Cloud.Firestore.V1.Target)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.7.0/Google.Cloud.Firestore.V1.Target)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.6.0/Google.Cloud.Firestore.V1.Target)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.5.1/Google.Cloud.Firestore.V1.Target)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.4.0/Google.Cloud.Firestore.V1.Target)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.3.0/Google.Cloud.Firestore.V1.Target)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.2.0/Google.Cloud.Firestore.V1.Target)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.1.0/Google.Cloud.Firestore.V1.Target)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/3.0.0/Google.Cloud.Firestore.V1.Target)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.5.0/Google.Cloud.Firestore.V1.Target)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.4.0/Google.Cloud.Firestore.V1.Target)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Firestore.V1/2.3.0/Google.Cloud.Firestore.V1.Target) \n\n public sealed class Target : IMessage\u003cTarget\u003e, IEquatable\u003cTarget\u003e, IDeepCloneable\u003cTarget\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Firestore v1 API class Target.\n\nA specification of a set of documents to listen to. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Target \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Target](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Target), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Target](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Target), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Target](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1.Target), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Firestore.V1](/dotnet/docs/reference/Google.Cloud.Firestore.V1/latest/Google.Cloud.Firestore.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Firestore.V1.dll\n\nConstructors\n------------\n\n### Target()\n\n public Target()\n\n### Target(Target)\n\n public Target(Target other)\n\nProperties\n----------\n\n### Documents\n\n public Target.Types.DocumentsTarget Documents { get; set; }\n\nA target specified by a set of document names.\n\n### ExpectedCount\n\n public int? ExpectedCount { get; set; }\n\nThe number of documents that last matched the query at the resume token or\nread time.\n\nThis value is only relevant when a `resume_type` is provided. This value\nbeing present and greater than zero signals that the client wants\n`ExistenceFilter.unchanged_names` to be included in the response.\n\n### HasResumeToken\n\n public bool HasResumeToken { get; }\n\nGets whether the \"resume_token\" field is set\n\n### Once\n\n public bool Once { get; set; }\n\nIf the target should be removed once it is current and consistent.\n\n### Query\n\n public Target.Types.QueryTarget Query { get; set; }\n\nA target specified by a query.\n\n### ReadTime\n\n public Timestamp ReadTime { get; set; }\n\nStart listening after a specific `read_time`.\n\nThe client must know the state of matching documents at this time.\n\n### ResumeToken\n\n public ByteString ResumeToken { get; set; }\n\nA resume token from a prior\n\\[TargetChange\\]\\[google.firestore.v1.TargetChange\\] for an identical target.\n\nUsing a resume token with a different target is unsupported and may fail.\n\n### ResumeTypeCase\n\n public Target.ResumeTypeOneofCase ResumeTypeCase { get; }\n\n### TargetId\n\n public int TargetId { get; set; }\n\nThe target ID that identifies the target on the stream. Must be a positive\nnumber and non-zero.\n\nIf `target_id` is 0 (or unspecified), the server will assign an ID for this\ntarget and return that in a `TargetChange::ADD` event. Once a target with\n`target_id=0` is added, all subsequent targets must also have\n`target_id=0`. If an `AddTarget` request with `target_id != 0` is\nsent to the server after a target with `target_id=0` is added, the server\nwill immediately send a response with a `TargetChange::Remove` event.\n\nNote that if the client sends multiple `AddTarget` requests\nwithout an ID, the order of IDs returned in `TargetChage.target_ids` are\nundefined. Therefore, clients should provide a target ID instead of relying\non the server to assign one.\n\nIf `target_id` is non-zero, there must not be an existing active target on\nthis stream with the same ID.\n\n### TargetTypeCase\n\n public Target.TargetTypeOneofCase TargetTypeCase { get; }"]]