郑州声乐培训班:Mongodb Connection Strings (auth user)
来源:百度文库 编辑:九乡新闻网 时间:2024/05/01 22:45:52
Connection Strings
Creating ConnectionStrings via code
The simples way to create an ConnectionString is to create MongoConnectionStringBuilder class, fill its properties and cal ToString().
var builder = new MongoConnectionStringBuilder();builder.Username = "test";var mongo = new Mongo(builder.ToString());
Formatting
The driver supports two ways of declaring ConnectionStrings. The MongoDB Url style and the ADO.NET style.
MongoDB Url style
Format: mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/database]?property1=value&property2=value (not case sensitive)
Example: mongodb://test:foo@localost:1234,server2:1234/admin?pooled=true
ADO.NET style
Format: property1=value;propery2=value (not case sensitive)
Example: Server=localhost:1234,server2:1234;Username=test;Password=foo;Pooled=true;
Property overview
- Username (Default: ,Alias: "user id","user"): Authentication username (leave empty if no auth is required)
- Password (Default: ): Authentication password (leave empty if no auth is required)
- Pooled (Default: true): If true the driver uses connection pooling
- Database (Default: "admin", Alias: "data source"): The database which is used when the ConnectionString is used to create a MongoDatabase directly instead of using a Mongo object.
- MaximumPoolSize (Default: 100, Alias: "max pool size"): Controls how much connection the pool can grow to.
- MinimumPoolSize (Default: 0, Alias: "min pool size"): Controls how much connection the pool keeps open. The pool ensures the connections are opened when the first connection is requested
- ConnectionLifetime (Default: , Alias: "connection lifetime"): Controls how long the pool an unused connection keeps open.
- ConnectTimeout (Default: 15, Alias: "connecttimeout"): Controls how many seconds the driver waits before its throws an exception if a connection dose not receives or sends data.
- Server: (Default: localhost:27017, Alias: "servers"): A list of servers the driver should connect to. If more the one server is given, the driver automatically assumes it connects to a replicaset.
download.rar
Mongodb Connection Strings (auth user)
C++ Strings
Oracle Connection String Samples
MongoDB 优化
ADO Connection对象连接数据库
net user 命令详解
user agent用户代理
Net User 终极用法
User Generated Content Principles
Mongodb源码分析--Mongos
Mongodb Mapreduce 初窥
Mongodb Mapreduce 初窥
我为什么选择MongoDB
MongoDB分片杂谈
MongoDB auto shard介绍
Memcache and Mongodb
mongodb有关的研究
MongoDB系列文章推荐
MongoDB: 10. MapReduce
MongoDB 主从复制配置
MongoDB主主复制
MongoDB应用实战
吉他大师Govi《No Strings Attached》320K/MP3
[Python]MySQLdb User's Guide