Class MongoDbDataStore
Implements MongoDB general data store that supports CRUD operations.
This class IS thread-safe load/save/delete operations
Inheritance
System.Object
MongoDbDataStore
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.MongoDb.dll
Syntax
public class MongoDbDataStore : MongoDbDataStoreBase, ICRUDDataStoreImplementation, ICRUDDataStore, ICRUDOperations, ICRUDTransactionOperations, IDataStoreImplementation, IDataStore, IApplicationComponent, IDisposable, IConfigurable, IInstrumentable, IExternallyParameterized
Constructors
MongoDbDataStore(IApplicationComponent)
Declaration
public MongoDbDataStore(IApplicationComponent director)
Parameters
MongoDbDataStore(IApplication)
Declaration
public MongoDbDataStore(IApplication app)
Parameters
Fields
SCRIPT_FILE_SUFFIX
Declaration
public const string SCRIPT_FILE_SUFFIX = ".mon.json"
Field Value
Type |
Description |
System.String |
|
Properties
Converter
Declaration
public DataDocConverter Converter { get; }
Property Value
QueryResolver
Declaration
public ICRUDQueryResolver QueryResolver { get; }
Property Value
ScriptFileSuffix
Declaration
public virtual string ScriptFileSuffix { get; }
Property Value
Type |
Description |
System.String |
|
StoreType
Declaration
public virtual CRUDDataStoreType StoreType { get; }
Property Value
SupportsTransactions
Declaration
public virtual bool SupportsTransactions { get; }
Property Value
Type |
Description |
System.Boolean |
|
SupportsTrueAsynchrony
Declaration
public virtual bool SupportsTrueAsynchrony { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
BeginTransaction(IsolationLevel, TransactionDisposeBehavior)
Declaration
public virtual CRUDTransaction BeginTransaction(IsolationLevel iso = IsolationLevel.ReadCommitted, TransactionDisposeBehavior behavior = TransactionDisposeBehavior.CommitOnDispose)
Parameters
Returns
BeginTransactionAsync(IsolationLevel, TransactionDisposeBehavior)
Declaration
public virtual Task<CRUDTransaction> BeginTransactionAsync(IsolationLevel iso = IsolationLevel.ReadCommitted, TransactionDisposeBehavior behavior = TransactionDisposeBehavior.CommitOnDispose)
Parameters
Returns
CheckCRUDResult(CRUDResult, String, String)
Declaration
public static void CheckCRUDResult(CRUDResult result, string schema, string operation)
Parameters
Type |
Name |
Description |
CRUDResult |
result |
|
System.String |
schema |
|
System.String |
operation |
|
Declaration
public override void Configure(IConfigSectionNode node)
Parameters
Overrides
Delete(Doc, IDataStoreKey)
Declaration
public int Delete(Doc row, IDataStoreKey key = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DeleteAsync(Doc, IDataStoreKey)
Declaration
public virtual Task<int> DeleteAsync(Doc row, IDataStoreKey key = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
DoDelete(Database, Doc, IDataStoreKey)
Declaration
protected virtual int DoDelete(Database db, Doc row, IDataStoreKey key)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoInsert(Database, Doc, FieldFilterFunc)
Declaration
protected virtual int DoInsert(Database db, Doc row, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoUpdate(Database, Doc, IDataStoreKey, FieldFilterFunc)
Declaration
protected virtual int DoUpdate(Database db, Doc row, IDataStoreKey key, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
DoUpsert(Database, Doc, FieldFilterFunc)
Declaration
protected virtual int DoUpsert(Database db, Doc row, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
ExecuteWithoutFetch(Query[])
Declaration
public virtual int ExecuteWithoutFetch(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteWithoutFetchAsync(Query[])
Declaration
public virtual Task<int> ExecuteWithoutFetchAsync(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
GetCollectionName(Schema)
Declaration
protected string GetCollectionName(Schema schema)
Parameters
Type |
Name |
Description |
Schema |
schema |
|
Returns
Type |
Description |
System.String |
|
GetSchema(Query)
Declaration
public virtual Schema GetSchema(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
GetSchemaAsync(Query)
Declaration
public virtual Task<Schema> GetSchemaAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Schema> |
|
Insert(Doc, FieldFilterFunc)
Declaration
public virtual int Insert(Doc row, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
InsertAsync(Doc, FieldFilterFunc)
Declaration
public virtual Task<int> InsertAsync(Doc row, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Load(Query[])
Declaration
public virtual List<RowsetBase> Load(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Collections.Generic.List<RowsetBase> |
|
LoadAsync(Query[])
Declaration
public virtual Task<List<RowsetBase>> LoadAsync(params Query[] queries)
Parameters
Type |
Name |
Description |
Query[] |
queries |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.List<RowsetBase>> |
|
LoadOneDoc(Query)
Declaration
public virtual Doc LoadOneDoc(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
LoadOneDocAsync(Query)
Declaration
public virtual Task<Doc> LoadOneDocAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Doc> |
|
LoadOneRowset(Query)
Declaration
public virtual RowsetBase LoadOneRowset(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
LoadOneRowsetAsync(Query)
Declaration
public virtual Task<RowsetBase> LoadOneRowsetAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<RowsetBase> |
|
MakeScriptQueryHandler(QuerySource)
Declaration
public CRUDQueryHandler MakeScriptQueryHandler(QuerySource querySource)
Parameters
Returns
OpenCursor(Query)
Declaration
public virtual Cursor OpenCursor(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
OpenCursorAsync(Query)
Declaration
public virtual Task<Cursor> OpenCursorAsync(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Cursor> |
|
Save(RowsetBase[])
Declaration
public virtual int Save(params RowsetBase[] rowsets)
Parameters
Returns
Type |
Description |
System.Int32 |
|
SaveAsync(RowsetBase[])
Declaration
public virtual Task<int> SaveAsync(params RowsetBase[] rowsets)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Update(Doc, IDataStoreKey, FieldFilterFunc)
Declaration
public virtual int Update(Doc row, IDataStoreKey key = null, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
UpdateAsync(Doc, IDataStoreKey, FieldFilterFunc)
Declaration
public virtual Task<int> UpdateAsync(Doc row, IDataStoreKey key = null, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Upsert(Doc, FieldFilterFunc)
Declaration
public virtual int Upsert(Doc row, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
UpsertAsync(Doc, FieldFilterFunc)
Declaration
public virtual Task<int> UpsertAsync(Doc row, FieldFilterFunc filter = null)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Int32> |
|
Implements
System.IDisposable
Extension Methods