public sealed class KeySet : IMessage<KeySet>, IEquatable<KeySet>, IDeepCloneable<KeySet>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Spanner v1 API class KeySet.
KeySet defines a collection of Cloud Spanner keys and/or key ranges. All
the keys are expected to be in the same table or index. The keys need
not be sorted in any particular way.
If the same key is specified multiple times in the set (for example
if two ranges, two keys, or a key and a range overlap), Cloud Spanner
behaves as if the key were only specified once.
For convenience all can be set to true to indicate that this
KeySet matches all keys in the table or index. Note that any keys
specified in keys or ranges are only yielded once.
A list of specific keys. Entries in keys should have exactly as
many elements as there are columns in the primary or index key
with which this KeySet is used. Individual key values are
encoded as described [here][google.spanner.v1.TypeCode].
[[["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 \u003ccode\u003eKeySet\u003c/code\u003e class in the Google Cloud Spanner v1 API defines a collection of keys and key ranges for querying data, where all keys must be from the same table or index.\u003c/p\u003e\n"],["\u003cp\u003eVersion 4.4.0 is one of the available versions, with newer beta and stable versions like 5.0.0-beta05 and 4.6.0, as well as older versions ranging down to 3.5.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eKeySet\u003c/code\u003e class implements interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and is inherited from the \u003ccode\u003eobject\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eKeySet\u003c/code\u003e can represent all keys in a table or index if the \u003ccode\u003eAll\u003c/code\u003e property is set to \u003ccode\u003etrue\u003c/code\u003e, and if keys are specified multiple times, it only counts them once.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eKeys\u003c/code\u003e property is used for a list of specific keys, and the \u003ccode\u003eRanges\u003c/code\u003e property is used to define a list of key ranges in the \u003ccode\u003eKeySet\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]