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

30.36.1. Type Parameters

T

The type of the data model.

30.36.2. Properties

30.36.2.1. CollectionName

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

string CollectionName { get; }

30.36.2.1.1. Property Value

string

30.36.3. Methods

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

30.36.3.1.1. Parameters

sessionHandle IClientSessionHandle

MongoDB Client session

collection IMongoCollection<T>

MongoDDB Collection in which to insert data

initDatabase InitDatabase

Data to insert

30.36.3.1.2. Returns

Task

Task representing the asynchronous execution of the method

30.36.3.2. InitializeIndexes(MongoDB)

Setup indexes for the collection Can be called multiple times

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

30.36.3.2.1. Parameters

options MongoDB

Options for MongoDB

30.36.3.2.2. Returns

ICollection<CreateIndexModel<T>>

Task representing the asynchronous execution of the method

30.36.3.3. ShardCollectionAsync(IClientSessionHandle, MongoDB)

Setup sharding for the collection Can be called multiple times

Task ShardCollectionAsync(IClientSessionHandle sessionHandle, MongoDB options)

30.36.3.3.1. Parameters

sessionHandle IClientSessionHandle

MongoDB Client session

options MongoDB

Options for MongoDB

30.36.3.3.2. Returns

Task

Task representing the asynchronous execution of the method