Table of Contents

Method IndexExists

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

IndexExists(IMongoIndexKeys)

Tests whether an index exists.

public virtual bool IndexExists(IMongoIndexKeys keys)

Parameters

keys IMongoIndexKeys

The indexed fields (usually an IndexKeysDocument or constructed using the IndexKeys builder).

Returns

bool

True if the index exists.

IndexExists(params string[])

Tests whether an index exists.

public virtual bool IndexExists(params string[] keyNames)

Parameters

keyNames string[]

The names of the fields in the index.

Returns

bool

True if the index exists.