26.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>
26.36.1. Type Parameters
T
The type of the data model.
26.36.2. Properties
26.36.2.1. CollectionName
Gets the name of the MongoDB collection associated with the data model.
string CollectionName { get; }
26.36.2.1.1. Property Value
26.36.3. Methods
26.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)
26.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
26.36.3.1.2. Returns
Task representing the asynchronous execution of the method
26.36.3.2. InitializeIndexes(MongoDB)
Setup indexes for the collection Can be called multiple times
ICollection<CreateIndexModel<T>> InitializeIndexes(MongoDB options)
26.36.3.2.1. Parameters
options MongoDB
Options for MongoDB
26.36.3.2.2. Returns
ICollection<CreateIndexModel<T>>
Task representing the asynchronous execution of the method