Google Cloud Datastore v1 API - Class Filter (4.10.0)

public sealed class Filter : IMessage<Filter>, IEquatable<Filter>, IDeepCloneable<Filter>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Datastore v1 API class Filter.

A holder for any type of filter.

Inheritance

object > Filter

Namespace

Google.Cloud.Datastore.V1

Assembly

Google.Cloud.Datastore.V1.dll

Constructors

Filter()

public Filter()

Filter(Filter)

public Filter(Filter other)
Parameter
NameDescription
otherFilter

Properties

CompositeFilter

public CompositeFilter CompositeFilter { get; set; }

A composite filter.

Property Value
TypeDescription
CompositeFilter

FilterTypeCase

public Filter.FilterTypeOneofCase FilterTypeCase { get; }
Property Value
TypeDescription
FilterFilterTypeOneofCase

PropertyFilter

public PropertyFilter PropertyFilter { get; set; }

A filter on a property.

Property Value
TypeDescription
PropertyFilter

Methods

And(params Filter[])

public static Filter And(params Filter[] filters)

Creates a composite filter which is the logical "AND" of all the specified filters.

Parameter
NameDescription
filtersFilter

Set of filters to combine. Must not be null or empty, or contain null references.

Returns
TypeDescription
Filter

A filter representing the logical "AND" of all the elements in filters.

And(IEnumerable<Filter>)

public static Filter And(IEnumerable<Filter> filters)

Creates a composite filter which is the logical "AND" of all the specified filters.

Parameter
NameDescription
filtersIEnumerableFilter

Set of filters to combine. Must not be null or empty, or contain null references.

Returns
TypeDescription
Filter

A filter representing the logical "AND" of all the elements in filters.

Equal(string, Value)

public static Filter Equal(string propertyName, Value propertyValue)

Creates a filter to check that the specified property is equal to a given value.

Parameters
NameDescription
propertyNamestring

The name of the property. Must not be null.

propertyValueValue

The value to compare against. May be null, which indicates a value with NullValue set.

Returns
TypeDescription
Filter

The newly created filter.

GreaterThan(string, Value)

public static Filter GreaterThan(string propertyName, Value propertyValue)

Creates a filter to check that the specified property is greater than a given value.

Parameters
NameDescription
propertyNamestring

The name of the property. Must not be null.

propertyValueValue

The value to compare against. May be null, which indicates a value with NullValue set.

Returns
TypeDescription
Filter

The newly created filter.

GreaterThanOrEqual(string, Value)

public static Filter GreaterThanOrEqual(string propertyName, Value propertyValue)

Creates a filter to check that the specified property is greater than or equal to a given value.

Parameters
NameDescription
propertyNamestring

The name of the property. Must not be null.

propertyValueValue

The value to compare against. May be null, which indicates a value with NullValue set.

Returns
TypeDescription
Filter

The newly created filter.

HasAncestor(Key)

public static Filter HasAncestor(Key ancestorKey)

Creates a filter to check that an entity has the specified key as an ancestor.

Parameter
NameDescription
ancestorKeyKey

The key to check against. Must not be null.

Returns
TypeDescription
Filter

The newly created filter.

In(string, ArrayValue)

public static Filter In(string value, ArrayValue collection)

Creates a filter to check that the specified property is in a given array of values.

Parameters
NameDescription
valuestring

The name of the property. Must not be null.

collectionArrayValue

The array of values to compare against. Must not be null.

Returns
TypeDescription
Filter

The newly created filter.

LessThan(string, Value)

public static Filter LessThan(string propertyName, Value propertyValue)

Creates a filter to check that the specified property is less than a given value.

Parameters
NameDescription
propertyNamestring

The name of the property. Must not be null.

propertyValueValue

The value to compare against. May be null, which indicates a value with NullValue set.

Returns
TypeDescription
Filter

The newly created filter.

LessThanOrEqual(string, Value)

public static Filter LessThanOrEqual(string propertyName, Value propertyValue)

Creates a filter to check that the specified property is less than or equal to a given value.

Parameters
NameDescription
propertyNamestring

The name of the property. Must not be null.

propertyValueValue

The value to compare against. May be null, which indicates a value with NullValue set.

Returns
TypeDescription
Filter

The newly created filter.

NotEqual(string, Value)

public static Filter NotEqual(string propertyName, Value propertyValue)

Creates a filter to check that the specified property is not equal to a given value.

Parameters
NameDescription
propertyNamestring

The name of the property. Must not be null.

propertyValueValue

The value to compare against. May be null, which indicates a value with NullValue set.

Returns
TypeDescription
Filter

The newly created filter.

NotIn(string, ArrayValue)

public static Filter NotIn(string value, ArrayValue collection)

Creates a filter to check that the specified property is not in a given array of values.

Parameters
NameDescription
valuestring

The name of the property. Must not be null.

collectionArrayValue

The array of values to compare against. Must not be null.

Returns
TypeDescription
Filter

The newly created filter.

Or(params Filter[])

public static Filter Or(params Filter[] filters)

Creates a composite filter which is the logical "OR" of all the specified filters.

Parameter
NameDescription
filtersFilter

Set of filters to combine. Must not be null or empty, or contain null references.

Returns
TypeDescription
Filter

A filter representing the logical "OR" of all the elements in filters.

Or(IEnumerable<Filter>)

public static Filter Or(IEnumerable<Filter> filters)

Creates a composite filter which is the logical "OR" of all the specified filters.

Parameter
NameDescription
filtersIEnumerableFilter

Set of filters to combine. Must not be null or empty, or contain null references.

Returns
TypeDescription
Filter

A filter representing the logical "OR" of all the elements in filters.

Property(string, Value, Operator)

public static Filter Property(string propertyName, Value propertyValue, PropertyFilter.Types.Operator op)

Creates a filter comparing the specified property with a given value, using a specified operator.

Parameters
NameDescription
propertyNamestring

The name of the property. Must not be null.

propertyValueValue

The value to compare against. May be null, which indicates a value with NullValue set.

opPropertyFilterTypesOperator

The comparison operator to use. Must be one of the PropertyFilter.Types.Operator values, and not Unspecified.

Returns
TypeDescription
Filter

The newly created filter.

Remarks

If the operator is known in advance, methods such as Equal(string, Value) and GreaterThan(string, Value) usually allow for better readability. This method is intended for situations where the operator is only known dynamically.