abstract public
|
#
call( $command, $arguments = [] )
|
public
|
#
_isSelf( )
{ _isSelf : 1 } INTERNAL ONLY
{ _isSelf : 1 } INTERNAL ONLY
|
public
|
#
aggregate( )
{ pipeline: [ { $operator: {...}}, ... ], explain: , allowDiskUse: , cursor: {batchSize: } }
See http://dochub.mongodb.org/core/aggregation for more details.
{ pipeline: [ { $operator: {...}}, ... ], explain: , allowDiskUse: , cursor: {batchSize: } }
See http://dochub.mongodb.org/core/aggregation for more details.
|
public
|
#
applyOps( )
internal (sharding)
{ applyOps : [ ] , preCondition : [ { ns : ... , q : ... , res : ... } ] }
internal (sharding)
{ applyOps : [ ] , preCondition : [ { ns : ... , q : ... , res : ... } ] }
|
public
|
|
public
|
|
public
|
#
buildInfo( )
get version #, etc.
{ buildinfo:1 }
get version #, etc.
{ buildinfo:1 }
|
public
|
|
public
|
#
cloneDb( )
clone this database from an instance of the db on another host
{clone: "host13"[, slaveOk: ]}
clone this database from an instance of the db on another host
{clone: "host13"[, slaveOk: ]}
|
public
|
#
cloneCollection( )
{ cloneCollection: , from: [,query: ] [,copyIndexes:] }
Copies a collection from one server to another. Do not use on a single server as the destination is placed at the same db.collection (namespace) as the source.
{ cloneCollection: , from: [,query: ] [,copyIndexes:] }
Copies a collection from one server to another. Do not use on a single server as the destination is placed at the same db.collection (namespace) as the source.
|
public
|
#
cloneCollectionAsCapped( )
{ cloneCollectionAsCapped:, toCollection:, size: }
{ cloneCollectionAsCapped:, toCollection:, size: }
|
public
|
#
collMod( )
Sets collection options.
Example: { collMod: 'foo', usePowerOf2Sizes:true }
Example: { collMod: 'foo', index: {keyPattern: {a: 1}, expireAfterSeconds: 600} Example: { collMod: 'foo', index: {name: 'bar', expireAfterSeconds: 600} }
Sets collection options.
Example: { collMod: 'foo', usePowerOf2Sizes:true }
Example: { collMod: 'foo', index: {keyPattern: {a: 1}, expireAfterSeconds: 600} Example: { collMod: 'foo', index: {name: 'bar', expireAfterSeconds: 600} }
|
public
|
#
collStats( )
{ collStats:"blog.posts" , scale : 1 } scale divides sizes e.g. for KB use 1024
avgObjSize - in bytes
{ collStats:"blog.posts" , scale : 1 } scale divides sizes e.g. for KB use 1024
avgObjSize - in bytes
|
public
|
#
compact( )
compact collection
warning: this operation locks the database and is slow. you can cancel with killOp()
{ compact : , [force:], [validate:],
[paddingFactor:], [paddingBytes:] }
force - allows to run on a replica set primary
validate - check records are noncorrupt before adding to newly compacting extents. slower but safer (defaults to true in this version)
compact collection
warning: this operation locks the database and is slow. you can cancel with killOp()
{ compact : , [force:], [validate:],
[paddingFactor:], [paddingBytes:] }
force - allows to run on a replica set primary
validate - check records are noncorrupt before adding to newly compacting extents. slower but safer (defaults to true in this version)
|
public
|
#
connPoolStats( )
stats about connections between servers in a replica set or sharded cluster.
stats about connections between servers in a replica set or sharded cluster.
|
public
|
|
public
|
#
connectionStatus( )
Returns connection-specific information such as logged-in users and their roles
Returns connection-specific information such as logged-in users and their roles
|
public
|
|
public
|
#
count( )
count objects in collection
count objects in collection
|
public
|
#
create( )
create a collection explicitly
{ create: [, capped: , size: , max: ] }
create a collection explicitly
{ create: [, capped: , size: , max: ] }
|
public
|
|
public
|
#
createRole( )
Adds a role to the system
Adds a role to the system
|
public
|
#
createUser( )
Adds a user to the system
Adds a user to the system
|
public
|
|
public
|
#
dataSize( )
determine data size for a set of data in a certain range
example: { dataSize:"blog.posts", keyPattern:{x:1}, min:{x:10}, max:{x:55} }
min and max parameters are optional. They must either both be included or both omitted
keyPattern is an optional parameter indicating an index pattern that would be usefulfor iterating over the min/max bounds. If keyPattern is omitted, it is inferred from the structure of min.
note: This command may take a while to run
determine data size for a set of data in a certain range
example: { dataSize:"blog.posts", keyPattern:{x:1}, min:{x:10}, max:{x:55} }
min and max parameters are optional. They must either both be included or both omitted
keyPattern is an optional parameter indicating an index pattern that would be usefulfor iterating over the min/max bounds. If keyPattern is omitted, it is inferred from the structure of min.
note: This command may take a while to run
|
public
|
|
public
|
#
dbStats( )
Get stats on a database. Not instantaneous. Slower for databases with large .ns files.
Example: { dbStats:1, scale:1 }
Get stats on a database. Not instantaneous. Slower for databases with large .ns files.
Example: { dbStats:1, scale:1 }
|
public
|
|
public
|
#
distinct( )
{ distinct : 'collection name' , key : 'a.b' , query : {} }
{ distinct : 'collection name' , key : 'a.b' , query : {} }
|
public
|
|
public
|
#
drop( )
drop a collection
{drop : }
drop a collection
{drop : }
|
public
|
#
dropAllRolesFromDatabase( )
Drops all roles from the given database. Before deleting the roles completely it must remove them from any users or other roles that reference them. If any errors occur in the middle of that process it's possible to be left in a state where the roles have been removed from some user/roles but otherwise still exist.
Drops all roles from the given database. Before deleting the roles completely it must remove them from any users or other roles that reference them. If any errors occur in the middle of that process it's possible to be left in a state where the roles have been removed from some user/roles but otherwise still exist.
|
public
|
|
public
|
#
dropDatabase( )
drop (delete) this database
drop (delete) this database
|
public
|
#
dropIndexes( )
drop indexes for a collection
drop indexes for a collection
|
public
|
#
dropRole( )
Drops a single role. Before deleting the role completely it must remove it from any users or roles that reference it. If any errors occur in the middle of that process it's possible to be left in a state where the role has been removed from some user/roles but otherwise still exists.
Drops a single role. Before deleting the role completely it must remove it from any users or roles that reference it. If any errors occur in the middle of that process it's possible to be left in a state where the role has been removed from some user/roles but otherwise still exists.
|
public
|
|
public
|
#
evalJs( )
DEPRECATED
Evaluate javascript at the server.
http://dochub.mongodb.org/core/serversidecodeexecution
DEPRECATED
Evaluate javascript at the server.
http://dochub.mongodb.org/core/serversidecodeexecution
|
public
|
#
explain( )
explain database reads and writes
explain database reads and writes
|
public
|
#
features( )
return build level feature settings
return build level feature settings
|
public
|
#
filemd5( )
example: { filemd5 : ObjectId(aaaaaaa) , root : "fs" }
example: { filemd5 : ObjectId(aaaaaaa) , root : "fs" }
|
public
|
|
public
|
#
findAndModify( )
{ findAndModify: "collection", query: {processed:false}, update: {$set: {processed:true}}, new: true}
{ findAndModify: "collection", query: {processed:false}, remove: true, sort: {priority:-1}}
Either update or remove is required, all other fields have default values.
Output is in the "value" field
{ findAndModify: "collection", query: {processed:false}, update: {$set: {processed:true}}, new: true}
{ findAndModify: "collection", query: {processed:false}, remove: true, sort: {priority:-1}}
Either update or remove is required, all other fields have default values.
Output is in the "value" field
|
public
|
#
forceerror( )
for testing purposes only. forces a user assertion exception
for testing purposes only. forces a user assertion exception
|
public
|
#
geoNear( )
http://dochub.mongodb.org/core/geo#GeospatialIndexing-geoNearCommand
http://dochub.mongodb.org/core/geo#GeospatialIndexing-geoNearCommand
|
public
|
|
public
|
#
getLastError( )
return error status of the last operation on this connection
options:
{ fsync:true } - fsync before returning, or wait for journal commit if running with --journal
{ j:true } - wait for journal commit if running with --journal
{ w:n } - await replication to n servers (including self) before returning
{ w:'majority' } - await replication to majority of set
{ wtimeout:m} - timeout for w in m milliseconds
return error status of the last operation on this connection
options:
{ fsync:true } - fsync before returning, or wait for journal commit if running with --journal
{ j:true } - wait for journal commit if running with --journal
{ w:n } - await replication to n servers (including self) before returning
{ w:'majority' } - await replication to majority of set
{ wtimeout:m} - timeout for w in m milliseconds
|
public
|
#
getMore( )
retrieve more results from an existing cursor
retrieve more results from an existing cursor
|
public
|
#
getPrevError( )
check for errors since last reseterror commandcal
check for errors since last reseterror commandcal
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
group( )
http://dochub.mongodb.org/core/aggregation
http://dochub.mongodb.org/core/aggregation
|
public
|
|
public
|
#
hostInfo( )
returns information about the daemon's host
returns information about the daemon's host
|
public
|
|
public
|
#
isMaster( )
Check if this server is primary for a replica pair/set; also if it is --master or --slave in simple master/slave setups.
{ isMaster : 1 }
Check if this server is primary for a replica pair/set; also if it is --master or --slave in simple master/slave setups.
{ isMaster : 1 }
|
public
|
#
killCursors( )
kill a list of cursor ids
kill a list of cursor ids
|
public
|
|
public
|
#
listCommands( )
get a list of all db commands
get a list of all db commands
|
public
|
#
listIndexes( )
list indexes for a collection
list indexes for a collection
|
public
|
|
public
|
#
mapReduce( )
Run a map/reduce operation on the server.
Note this is used for aggregation, not querying, in MongoDB.
http://dochub.mongodb.org/core/mapreduce
Run a map/reduce operation on the server.
Note this is used for aggregation, not querying, in MongoDB.
http://dochub.mongodb.org/core/mapreduce
|
public
|
|
public
|
|
public
|
#
ping( )
a way to check that the server is alive. responds immediately even if server is in a db lock.
a way to check that the server is alive. responds immediately even if server is in a db lock.
|
public
|
#
planCacheClear( )
Drops one or all cached queries in a collection.
Drops one or all cached queries in a collection.
|
public
|
#
planCacheClearFilters( )
Clears index filter for a single query shape or, if the query shape is omitted, all filters for the collection.
Clears index filter for a single query shape or, if the query shape is omitted, all filters for the collection.
|
public
|
#
planCacheListFilters( )
Displays index filters for all query shapes in a collection.
Displays index filters for all query shapes in a collection.
|
public
|
#
planCacheListPlans( )
Displays the cached plans for a query shape.
Displays the cached plans for a query shape.
|
public
|
|
public
|
#
planCacheSetFilter( )
Sets index filter for a query shape. Overrides existing filter.
Sets index filter for a query shape. Overrides existing filter.
|
public
|
#
profile( )
enable or disable performance profiling
{ profile : }
0=off 1=log slow ops 2=log all
-1 to get current values
http://docs.mongodb.org/manual/reference/command/profile/#dbcmd.profile
enable or disable performance profiling
{ profile : }
0=off 1=log slow ops 2=log all
-1 to get current values
http://docs.mongodb.org/manual/reference/command/profile/#dbcmd.profile
|
public
|
|
public
|
|
public
|
#
repairDatabase( )
repair database. also compacts. note: slow.
repair database. also compacts. note: slow.
|
public
|
#
resetError( )
reset error state (used with getpreverror)
reset error state (used with getpreverror)
|
public
|
|
public
|
|
public
|
|
public
|
#
rolesInfo( )
Returns information about roles.
Returns information about roles.
|
public
|
#
saslContinue( )
Subsequent steps in a SASL authentication conversation.
Subsequent steps in a SASL authentication conversation.
|
public
|
#
saslStart( )
First step in a SASL authentication conversation.
First step in a SASL authentication conversation.
|
public
|
#
serverStatus( )
returns lots of administrative server statistics
returns lots of administrative server statistics
|
public
|
#
shardConnPoolStats( )
stats about the shard connection pool
stats about the shard connection pool
|
public
|
#
splitVector( )
Internal command.
examples:
{ splitVector : "blog.post" , keyPattern:{x:1} , min:{x:10} , max:{x:20}, maxChunkSize:200 }
maxChunkSize unit in MBs
May optionally specify 'maxSplitPoints' and 'maxChunkObjects' to avoid traversing the whole chunk
Internal command.
examples:
{ splitVector : "blog.post" , keyPattern:{x:1} , min:{x:10} , max:{x:20}, maxChunkSize:200 }
maxChunkSize unit in MBs
May optionally specify 'maxSplitPoints' and 'maxChunkObjects' to avoid traversing the whole chunk
{ splitVector : "blog.post" , keyPattern:{x:1} , min:{x:10} , max:{x:20}, force: true }
'force' will produce one split point even if data is small; defaults to false
NOTE: This command may take a while to run
|
public
|
#
touch( )
touch collection
Page in all pages of memory containing every extent for the given collection
{ touch : , [data : true] , [index : true] }
at least one of data or index must be true; default is both are false
touch collection
Page in all pages of memory containing every extent for the given collection
{ touch : , [data : true] , [index : true] }
at least one of data or index must be true; default is both are false
|
public
|
|
public
|
|
public
|
#
updateUser( )
Used to update a user, for example to change its password
Used to update a user, for example to change its password
|
public
|
#
usersInfo( )
Returns information about users.
Returns information about users.
|
public
|
#
validate( )
Validate contents of a namespace by scanning its data structures for correctness. Slow.
Add full:true option to do a more thorough check
Validate contents of a namespace by scanning its data structures for correctness. Slow.
Add full:true option to do a more thorough check
|
public
|
|