Class MongoClient
The central facade for working with MongoDB. The technology was tested against Mongo DB 3.+
The Azos MongoDB connector is purposely created for specific needs such as using MongoDB as a device yielding 4x-8x better throughput than the official driver.
It does not support: Mongo security, sharding and replication
Inheritance
System.Object
MongoClient
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 sealed class MongoClient : ApplicationComponent, IDisposable, IApplicationComponent, INamed, IConfigurable, IInstrumentable, IExternallyParameterized
Constructors
MongoClient(IApplicationComponent)
Creates a new instance of client.
For most applications it is sufficient to use the default singleton instance App.GetDefaultMongoClient()
Declaration
public MongoClient(IApplicationComponent director)
Parameters
MongoClient(IApplicationComponent, String)
Creates a new instance of client.
For most applications it is sufficient to use the default singleton instance App.GetDefaultMongoClient()
Declaration
public MongoClient(IApplicationComponent director, string name)
Parameters
MongoClient(IApplication)
Creates a new instance of client.
For most applications it is sufficient to use the default singleton instance App.GetDefaultMongoClient()
Declaration
public MongoClient(IApplication app)
Parameters
MongoClient(IApplication, String)
Creates a new instance of client.
For most applications it is sufficient to use the default singleton instance App.GetDefaultMongoClient()
Declaration
public MongoClient(IApplication app, string name)
Parameters
Fields
CONFIG_CS_DB_ATTR
Declaration
public const string CONFIG_CS_DB_ATTR = "db"
Field Value
Type |
Description |
System.String |
|
CONFIG_CS_ROOT_SECTION
Declaration
public const string CONFIG_CS_ROOT_SECTION = "mongo"
Field Value
Type |
Description |
System.String |
|
CONFIG_CS_SERVER_ATTR
Declaration
public const string CONFIG_CS_SERVER_ATTR = "server"
Field Value
Type |
Description |
System.String |
|
CONFIG_MONGO_CLIENT_SECTION
Declaration
public const string CONFIG_MONGO_CLIENT_SECTION = "mongo-db-client"
Field Value
Type |
Description |
System.String |
|
Properties
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
ConfigRoot
Returns the config root of the client that was set by the last call to Configure()
or App.CONFIG_MONGO_CLIENT_SECTION (which may be non-existent)
Declaration
public IConfigSectionNode ConfigRoot { get; }
Property Value
DefaultLocalServer
Returns ServerNode for local server on a default port
Declaration
public ServerNode DefaultLocalServer { get; }
Property Value
ExternalParameters
Declaration
public IEnumerable<KeyValuePair<string, Type>> ExternalParameters { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
InstrumentationEnabled
Declaration
[Config]
public bool InstrumentationEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Item[Node]
Returns an existing server node or creates a new one
Declaration
public ServerNode this[Node node] { get; }
Parameters
Type |
Name |
Description |
Node |
node |
|
Property Value
Name
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
Servers
Returns all connected servers
Declaration
public IRegistry<ServerNode> Servers { get; }
Property Value
Methods
Sets config root. If this method is never called then configuration is done of the App.CONFIG_MONGO_CLIENT_SECTION section
Declaration
public void Configure(IConfigSectionNode node)
Parameters
Destructor()
Declaration
protected override void Destructor()
Overrides
ExternalGetParameter(String, out Object, String[])
Declaration
public bool ExternalGetParameter(string name, out object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
ExternalParametersForGroups(String[])
Declaration
public IEnumerable<KeyValuePair<string, Type>> ExternalParametersForGroups(params string[] groups)
Parameters
Type |
Name |
Description |
System.String[] |
groups |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
ExternalSetParameter(String, Object, String[])
Declaration
public bool ExternalSetParameter(string name, object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
Implements
System.IDisposable
Extension Methods