# Class MongoUtils

Namespace
  adas_core.Infrastructure.Utils

Assembly
  adas-core.Infrastructure.dll

Provides utility methods for interacting with MongoDB.

    public class MongoUtils

Inheritance
  object
  MongoUtils

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### EnsureIndexes<TDocument>(IMongoCollection<TDocument>, List<CreateIndexModel<TDocument>>)

    public static Task EnsureIndexes<TDocument>(IMongoCollection<TDocument> collection, List<CreateIndexModel<TDocument>> expectedIndexes)

#### Parameters

`collection` IMongoCollection<TDocument>
`expectedIndexes` List<CreateIndexModel<TDocument>>

#### Returns

Task

#### Type Parameters

`TDocument`