26.31. Interface IMongoDataModelMapping<T>

Namespace: ArmoniK.Core.Adapters.MongoDB.Common
Assembly: ArmoniK.Core.Adapters.MongoDB.dll

Defines the contract for mapping a data model to a MongoDB collection.

public interface IMongoDataModelMapping<T>

26.31.1. Type Parameters

T

The type of the data model.

26.31.2. Properties

26.31.2.1. CollectionName

Gets the name of the MongoDB collection associated with the data model.

string CollectionName { get; }

26.31.2.1.1. Property Value

string

26.31.3. Methods

26.31.3.1. InitializeCollectionAsync(IClientSessionHandle, IMongoCollection<T>, InitDatabase)

Insert data into the collection after its creation. Can be called multiple times

Task InitializeCollectionAsync(IClientSessionHandle sessionHandle, IMongoCollection<T> collection, InitDatabase initDatabase)

26.31.3.1.1. Parameters

sessionHandle IClientSessionHandle

MongoDB Client session

collection IMongoCollection<T>

MongoDDB Collection in which to insert data

initDatabase InitDatabase

Data to insert

26.31.3.1.2. Returns

Task

Task representing the asynchronous execution of the method

26.31.3.2. InitializeIndexes(MongoDB)

Setup indexes for the collection Can be called multiple times

ICollection<CreateIndexModel<T>> InitializeIndexes(MongoDB options)

26.31.3.2.1. Parameters

options MongoDB

Options for MongoDB

26.31.3.2.2. Returns

ICollection<CreateIndexModel<T>>

Task representing the asynchronous execution of the method

26.31.3.3. ShardCollectionAsync(IClientSessionHandle, MongoDB)

Setup sharding for the collection Can be called multiple times

Task ShardCollectionAsync(IClientSessionHandle sessionHandle, MongoDB options)

26.31.3.3.1. Parameters

sessionHandle IClientSessionHandle

MongoDB Client session

options MongoDB

Options for MongoDB

26.31.3.3.2. Returns

Task

Task representing the asynchronous execution of the method