v1.0.0
Latest
2022.3+

Class FilterOption

A Generic class for creating option for querying sessions.

Inheritance
System.Object
FilterOption
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Unity.Services.Multiplayer
Syntax
public class FilterOption

Constructors

FilterOption(FilterField, String, FilterOperation)

A filter for an individual field that is applied to a query.

Declaration
public FilterOption(FilterField field, string value, FilterOperation operation)
Parameters
TypeNameDescription
FilterFieldfield

The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name.

System.Stringvalue

The value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as field (e.g. integer for MaxPlayers, datetime for Created, etc.). The value for datetime fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the "o" format specifier: return dateTime.ToString(\"o\", DateTimeFormatInfo.InvariantInfo);. Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings.

FilterOperationoperation

The operation used to compare the field to the filter value.

Properties

Field

The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name.

Declaration
public FilterField Field { get; }
Property Value
TypeDescription
FilterField

Operation

The operation used to compare the field to the filter value. Supports CONTAINS (only on the Name field), EQ (Equal), NE (Not Equal), LT (Less Than), LE (Less Than or Equal), GT (Greater Than), and GE (Greater Than or Equal).

Declaration
public FilterOperation Operation { get; }
Property Value
TypeDescription
FilterOperation

Value

The value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as field (e.g. integer for MaxPlayers, datetime for Created, etc.). The value for datetime fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the "o" format specifier: return dateTime.ToString(\"o\", DateTimeFormatInfo.InvariantInfo);. Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings.

Declaration
public string Value { get; }
Property Value
TypeDescription
System.String