Table of Contents

Method Exists

Namespace
MongoDB.Driver.Search
Assembly
MongoDB.Driver.dll

Exists(FieldDefinition<TDocument>)

Creates a search definition that tests if a path to a specified indexed field name exists in a document.

public SearchDefinition<TDocument> Exists(FieldDefinition<TDocument> path)

Parameters

path FieldDefinition<TDocument>

The field to test for.

Returns

SearchDefinition<TDocument>

An existence search definition.

Exists<TField>(Expression<Func<TDocument, TField>>)

Creates a search definition that tests if a path to a specified indexed field name exists in a document.

public SearchDefinition<TDocument> Exists<TField>(Expression<Func<TDocument, TField>> path)

Parameters

path Expression<Func<TDocument, TField>>

The field to test for.

Returns

SearchDefinition<TDocument>

An existence search definition.

Type Parameters

TField

The type of the field.