23.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>

23.31.1. Type Parameters

T

The type of the data model.

23.31.2. Properties

23.31.2.1. CollectionName

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

string CollectionName { get; }

23.31.2.1.1. Property Value

string

23.31.3. Methods

23.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)

23.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

23.31.3.1.2. Returns

Task

Task representing the asynchronous execution of the method

23.31.3.2. InitializeIndexesAsync(IClientSessionHandle, IMongoCollection<T>, MongoDB)

Setup indexes for the collection Can be called multiple times

Task InitializeIndexesAsync(IClientSessionHandle sessionHandle, IMongoCollection<T> collection, MongoDB options)

23.31.3.2.1. Parameters

sessionHandle IClientSessionHandle

MongoDB Client session

collection IMongoCollection<T>

MongoDDB Collection in which to insert data

options MongoDB

Options for MongoDB

23.31.3.2.2. Returns

Task

Task representing the asynchronous execution of the method

23.31.3.3. ShardCollectionAsync(IClientSessionHandle, MongoDB)

Setup sharding for the collection Can be called multiple times

Task ShardCollectionAsync(IClientSessionHandle sessionHandle, MongoDB options)

23.31.3.3.1. Parameters

sessionHandle IClientSessionHandle

MongoDB Client session

options MongoDB

Options for MongoDB

23.31.3.3.2. Returns

Task

Task representing the asynchronous execution of the method