The index to use to search and order rows from the target table if the read
operation should use a different index than the primary key, or null otherwise.
The rows will be returned in the order of the specified index.
The index to use to search and order rows from the target table if the read operation
should use a different index than the primary key.
The rows will be returned in the order of the specified index.
May not an empty string. Null means that the primary key of the table should be used for the read operation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eReadOptions\u003c/code\u003e class for Google.Cloud.Spanner.Data is 5.0.0-beta05, and there are several previous versions also available, ranging back to 3.5.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eReadOptions\u003c/code\u003e defines a read operation for a Spanner table within the \u003ccode\u003eGoogle.Cloud.Spanner.Data\u003c/code\u003e namespace and allows you to specify what columns to read.\u003c/p\u003e\n"],["\u003cp\u003eYou can control which columns are read using the \u003ccode\u003eColumns\u003c/code\u003e property, and you can also set a limit on the maximum number of rows to read using the \u003ccode\u003eLimit\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIndexName\u003c/code\u003e property allows for the use of a secondary index to search and sort the returned data from the target table.\u003c/p\u003e\n"],["\u003cp\u003eThere are several methods to create and configure \u003ccode\u003eReadOptions\u003c/code\u003e, including \u003ccode\u003eFromColumns\u003c/code\u003e for specifying columns to read, \u003ccode\u003eWithIndexName\u003c/code\u003e to use a different index, and \u003ccode\u003eWithLimit\u003c/code\u003e to set a maximum number of rows.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Spanner.Data - Class ReadOptions (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.ReadOptions)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/5.0.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.6.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.5.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.4.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.3.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.2.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.1.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.0.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.15.1/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.14.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.13.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.12.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.11.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.10.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.9.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.8.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.7.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.6.0/Google.Cloud.Spanner.Data.ReadOptions)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.5.0/Google.Cloud.Spanner.Data.ReadOptions) \n\n public sealed class ReadOptions\n\nReference documentation and code samples for the Google.Cloud.Spanner.Data class ReadOptions.\n\nReadOptions define a read operation for a Spanner table. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ReadOptions \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.Spanner.Data](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.Data.dll\n\nProperties\n----------\n\n### Columns\n\n public IReadOnlyList\u003cstring\u003e Columns { get; }\n\nReturns the columns that will be read from the target table. Cannot be null or empty.\n\n### IndexName\n\n public string IndexName { get; }\n\nThe index to use to search and order rows from the target table if the read\noperation should use a different index than the primary key, or null otherwise.\nThe rows will be returned in the order of the specified index.\n\n### Limit\n\n public long? Limit { get; }\n\nThe maximum number of rows to read from the target table, or null if there is no limit.\n\nMethods\n-------\n\n### FromColumns(IEnumerable\\\u003cstring\\\u003e)\n\n public static ReadOptions FromColumns(IEnumerable\u003cstring\u003e columns)\n\nCreates options to read the given columns using a ReadCommand.\n\n### FromColumns(params string\\[\\])\n\n public static ReadOptions FromColumns(params string[] columns)\n\nCreates options to read the given columns using a ReadCommand.\n\n### WithIndexName(string)\n\n public ReadOptions WithIndexName(string indexName)\n\nReturns a clone of this ReadOptions with the given index name.\n\n### WithLimit(long?)\n\n public ReadOptions WithLimit(long? limit)\n\nCreates a clone of this ReadOptions with the given limit."]]