您的位置:首页 > 运维架构 > Linux

linux权限命令

2015-08-23 19:54 369 查看
1.  

The standard connection uri
scheme is not yet supported by all of the drivers. All drivers support an
alternative method of specifying connections if this format is not supported.

 
2.  

The standard connection string
format is as below:

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

 
  a)  

mongodb://

is a required prefix
to identify that this is a string in the standard connection format.

  b)  

username:password@

are
optional. If given, the driver will attempt to login to a database after
connecting to a database server.

  c)  

host1

is the only required part
of the URI. It identifies a server address to connect to.

As many hosts as necessary may be specified (for connecting
to replica pairs/sets).

  d)  

:portX

is optional and defaults
to :27017

if not provided.

  e)  

/database

is the name of the
database to login to and thus is only relevant if the username:password@

syntax
is used. If not specified the "admin

" database will be used by
default.

  f)  

?options

are connection
options. Note that if database is absent there is still a /

required between
the last host and the ?

introducing the options. 

 
3. 

Options are name=value

pairs
and the pairs are separated either by "&

"" or ";

".

(These options
are not case sensitive):

  a)  

replicaSet=name


The driver
verifies that the name of the replica set it connects to matches this name. Implies that the hosts given are a seed list,
and the driver will attempt to find all members of the set.

  b)  

slaveOk=true|false


 
true

: sending all writes to the primary and
distributing reads to the secondaries. false

:all writes and reads are sent to
primary.

  c)  

safe=true|false


true

: the driver
sends a getLastError

command after every update to ensure that the update
succeeded.

  d)  

w=n


The driver adds { w : n }

to the getLastError

command.
Implies safe=true

. Updates will wait for replication to succeed on at least n

machines.

  e)  

wtimeoutMS=ms


The driver adds { wtimeout : ms }

to the getLastError

command. Implies safe=true

. The timeout for waiting on replication success.

  f)  

fsync=true|false


true

: the driver adds { fsync : true }

to the

getLastError

command. Implies safe=true

. Force MongoDB to flush all pending writes to the
data files.

  g)  

journal=true|false


true

: Sync to journal. Implies safe=true

.

  h)  

connectTimeoutMS=ms


How long a connection can take to be opened before timing
out.

  i)  

socketTimeoutMS=ms


How long a send or receive on a socket can take before
timing out.

 
4.  

The server will use one thread
per TCP connection, therefore it is highly recomended that your application use
some sort of connection pooling. Luckily, most drivers handle this for you
behind the scenes.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: