Table of Contents

Method Exists

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Exists(FieldDefinition<TDocument>, bool)

Creates an exists filter.

public FilterDefinition<TDocument> Exists(FieldDefinition<TDocument> field, bool exists = true)

Parameters

field FieldDefinition<TDocument>

The field.

exists bool

if set to true [exists].

Returns

FilterDefinition<TDocument>

An exists filter.

Exists(Expression<Func<TDocument, object>>, bool)

Creates an exists filter.

public FilterDefinition<TDocument> Exists(Expression<Func<TDocument, object>> field, bool exists = true)

Parameters

field Expression<Func<TDocument, object>>

The field.

exists bool

if set to true [exists].

Returns

FilterDefinition<TDocument>

An exists filter.