Search
Preparing search index...
The search index is not available
DefinitelyTyped
Inherited
Private
Externals
Only exported
mongodb
Db
Class Db
Index
Constructor methods
constructor
Properties
DEFAULT_URL
Methods
__executeQueryCommand
_callHandler
_findHandler
_hasHandler
_reRegisterHandler
_registerHandler
_removeHandler
addListener
addUser
admin
authenticate
close
collection
collectionNames
collections
collectionsInfo
command
connect
createCollection
createIndex
cursorInfo
db
dropCollection
dropDatabase
dropIndex
ensureIndex
eval
executeDbAdminCommand
executeDbCommand
indexInformation
lastError
logout
open
previousError
reIndex
removeUser
renameCollection
resetErrorHistory
stats
Constructor methods
constructor
(
databaseName
:
string
, serverConfig
:
Server
, dbOptions
?:
DbCreateOptions
)
:
Db
Parameters
databaseName:
string
serverConfig:
Server
dbOptions?:
DbCreateOptions
optional
Returns
Db
Properties
public
DEFAULT_URL
:
string
Methods
public
__executeQueryCommand
(
self
:
any
, db_command
:
any
, options
:
any
, callback
:
any
)
Parameters
self:
any
db_command:
any
options:
any
callback:
any
public
_callHandler
(
id
:
any
, document
:
any
, err
:
any
)
:
any
Parameters
id:
any
document:
any
err:
any
Returns
any
public
_findHandler
(
id
:
any
)
:
{ id: string; callback: Function; }
Parameters
id:
any
Returns
{ id: string; callback: Function; }
public
_hasHandler
(
id
:
any
)
:
any
Parameters
id:
any
Returns
any
public
_reRegisterHandler
(
newId
:
any
, object
:
any
, callback
:
Function
)
Parameters
newId:
any
object:
any
callback:
Function
public
_registerHandler
(
db_command
:
any
, raw
:
any
, connection
:
any
, exhaust
:
any
, callback
:
Function
)
Parameters
db_command:
any
raw:
any
connection:
any
exhaust:
any
callback:
Function
public
_removeHandler
(
id
:
any
)
:
any
Parameters
id:
any
Returns
any
public
addListener
(
event
:
string
, handler
:
(param: any) => any
)
:
any
Parameters
event:
string
handler:
(param: any) => any
Returns
any
public
addUser
(
username
:
string
, password
:
string
, callback
?:
(err: Error, result: any) => void
)
Parameters
username:
string
password:
string
callback?:
(err: Error, result: any) => void
optional
public
addUser
(
username
:
string
, password
:
string
, options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
username:
string
password:
string
options:
any
callback?:
(err: Error, result: any) => void
optional
public
admin
(
callback
:
(err: Error, result: any) => void
)
:
any
Parameters
callback:
(err: Error, result: any) => void
Returns
any
public
authenticate
(
userName
:
string
, password
:
string
, callback
?:
(err: Error, result: any) => void
)
Parameters
userName:
string
password:
string
callback?:
(err: Error, result: any) => void
optional
public
authenticate
(
userName
:
string
, password
:
string
, options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
userName:
string
password:
string
options:
any
callback?:
(err: Error, result: any) => void
optional
public
close
(
forceClose
?:
boolean
, callback
?:
(err: Error, result: any) => void
)
Parameters
forceClose?:
boolean
optional
callback?:
(err: Error, result: any) => void
optional
public
collection
(
collectionName
:
string
)
:
Collection
Parameters
collectionName:
string
Returns
Collection
public
collection
(
collectionName
:
string
, callback
:
(err: Error, collection: "mongodb".Collection) => void
)
:
Collection
Parameters
collectionName:
string
callback:
(err: Error, collection: "mongodb".Collection) => void
Returns
Collection
public
collection
(
collectionName
:
string
, options
:
MongoCollectionOptions
, callback
:
(err: Error, collection: "mongodb".Collection) => void
)
:
Collection
Parameters
collectionName:
string
options:
MongoCollectionOptions
callback:
(err: Error, collection: "mongodb".Collection) => void
Returns
Collection
public
collectionNames
(
collectionName
:
string
, options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
collectionName:
string
options:
any
callback?:
(err: Error, result: any) => void
optional
public
collections
(
callback
:
(err: Error, collections: "mongodb".Collection[]) => void
)
Parameters
callback:
(err: Error, collections: "mongodb".Collection[]) => void
public
collectionsInfo
(
collectionName
:
string
, callback
?:
(err: Error, result: any) => void
)
Parameters
collectionName:
string
callback?:
(err: Error, result: any) => void
optional
public
command
(
selector
:
Object
, callback
?:
(err: Error, result: any) => void
)
Parameters
selector:
Object
callback?:
(err: Error, result: any) => void
optional
public
command
(
selector
:
Object
, options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
selector:
Object
options:
any
callback?:
(err: Error, result: any) => void
optional
public
connect
(
url
:
string
, options
:
{ uri_decode_auth?: boolean; }
, callback
:
(err: Error, result: any) => void
)
Parameters
url:
string
options:
{ uri_decode_auth?: boolean; }
callback:
(err: Error, result: any) => void
public
createCollection
(
collectionName
:
string
, callback
?:
(err: Error, result: "mongodb".Collection) => void
)
Parameters
collectionName:
string
callback?:
(err: Error, result: "mongodb".Collection) => void
optional
public
createCollection
(
collectionName
:
string
, options
:
CollectionCreateOptions
, callback
?:
(err: Error, result: any) => void
)
Parameters
collectionName:
string
options:
CollectionCreateOptions
callback?:
(err: Error, result: any) => void
optional
public
createIndex
(
collectionName
:
any
, fieldOrSpec
:
any
, options
:
IndexOptions
, callback
:
Function
)
Parameters
collectionName:
any
fieldOrSpec:
any
options:
IndexOptions
callback:
Function
public
cursorInfo
(
options
:
any
, callback
:
Function
)
Parameters
options:
any
callback:
Function
public
db
(
dbName
:
string
)
:
Db
Parameters
dbName:
string
Returns
Db
public
dropCollection
(
collectionName
:
string
, callback
?:
(err: Error, result: any) => void
)
Parameters
collectionName:
string
callback?:
(err: Error, result: any) => void
optional
public
dropDatabase
(
callback
:
(err: Error, result: any) => void
)
Parameters
callback:
(err: Error, result: any) => void
public
dropIndex
(
collectionName
:
string
, indexName
:
string
, callback
:
Function
)
Parameters
collectionName:
string
indexName:
string
callback:
Function
public
ensureIndex
(
collectionName
:
any
, fieldOrSpec
:
any
, options
:
IndexOptions
, callback
:
Function
)
Parameters
collectionName:
any
fieldOrSpec:
any
options:
IndexOptions
callback:
Function
public
eval
(
code
:
any
, parameters
:
Array<any>
, options
?:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
code:
any
parameters:
Array<any>
options?:
any
optional
callback?:
(err: Error, result: any) => void
optional
public
executeDbAdminCommand
(
command_hash
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
command_hash:
any
callback?:
(err: Error, result: any) => void
optional
public
executeDbAdminCommand
(
command_hash
:
any
, options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
command_hash:
any
options:
any
callback?:
(err: Error, result: any) => void
optional
public
executeDbCommand
(
command_hash
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
command_hash:
any
callback?:
(err: Error, result: any) => void
optional
public
executeDbCommand
(
command_hash
:
any
, options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
command_hash:
any
options:
any
callback?:
(err: Error, result: any) => void
optional
public
indexInformation
(
collectionName
:
string
, options
:
any
, callback
:
Function
)
Parameters
collectionName:
string
options:
any
callback:
Function
public
lastError
(
options
:
Object
, connectionOptions
:
any
, callback
:
(err: Error, result: any) => void
)
Parameters
options:
Object
connectionOptions:
any
callback:
(err: Error, result: any) => void
public
logout
(
options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
options:
any
callback?:
(err: Error, result: any) => void
optional
public
logout
(
callback
:
(err: Error, result: any) => void
)
Parameters
callback:
(err: Error, result: any) => void
public
open
(
callback
:
(err: Error, db: "mongodb".Db) => void
)
Parameters
callback:
(err: Error, db: "mongodb".Db) => void
public
previousError
(
options
:
Object
, callback
:
(err: Error, result: any) => void
)
Parameters
options:
Object
callback:
(err: Error, result: any) => void
public
reIndex
(
collectionName
:
string
, callback
:
Function
)
Parameters
collectionName:
string
callback:
Function
public
removeUser
(
username
:
string
, callback
?:
(err: Error, result: any) => void
)
Parameters
username:
string
callback?:
(err: Error, result: any) => void
optional
public
removeUser
(
username
:
string
, options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
username:
string
options:
any
callback?:
(err: Error, result: any) => void
optional
public
renameCollection
(
fromCollection
:
string
, toCollection
:
string
, callback
?:
(err: Error, result: any) => void
)
Parameters
fromCollection:
string
toCollection:
string
callback?:
(err: Error, result: any) => void
optional
public
resetErrorHistory
(
callback
?:
(err: Error, result: any) => void
)
Parameters
callback?:
(err: Error, result: any) => void
optional
public
resetErrorHistory
(
options
:
any
, callback
?:
(err: Error, result: any) => void
)
Parameters
options:
any
callback?:
(err: Error, result: any) => void
optional
public
stats
(
options
:
any
, callback
:
Function
)
Parameters
options:
any
callback:
Function
Globals
GridFSStream
NodeJS
assert
buffer
child_process
cluster
crypto
dgram
dns
domain
events
fs
gridfs-stream
http
https
mongodb
net
os
path
punycode
querystring
readline
repl
stream
string_decoder
tls
tty
url
util
vm
zlib
Collection
CollectionCreateOptions
CollectionFindOptions
DbCreateOptions
IndexOptions
MapReduceOptions
MongoCollectionOptions
PKFactory
ServerOptions
SocketOptions
Cursor
CursorStream
Db
constructor
DEFAULT_URL
__executeQueryCommand
_callHandler
_findHandler
_hasHandler
_reRegisterHandler
_registerHandler
_removeHandler
addListener
addUser
admin
authenticate
close
collection
collectionNames
collections
collectionsInfo
command
connect
createCollection
createIndex
cursorInfo
db
dropCollection
dropDatabase
dropIndex
ensureIndex
eval
executeDbAdminCommand
executeDbCommand
indexInformation
lastError
logout
open
previousError
reIndex
removeUser
renameCollection
resetErrorHistory
stats
MongoClient
ObjectID
ReadPreference
Server