The client to talk to mongodb-scope-server from node.js or the browser.
Want to see what it can do? Check out ./examples
.
npm install --save mongodb-scope-client
var scope = require('mongodb-scope-client')([endpoint], [connection]);
endpoint
(optional, String) ... Where the server is running [Defaulthttp://localhost:29017
].connection
(optional, Object|mongodb-connection-model) ... MongoDB connection options [Default{}
].
Get details of the instance you're currently connected to like database_names, results of the hostInfo and buildInfo mongo commands.
opts
(optional, Object) ... Placeholder for future optionsfn
(optional, Function) ... A response callback(err, data)
List all deployments this scout-server instance has connected to.
opts
(optional, Object) ... Placeholder for future options.fn
(optional, Function) ... A response callback(err, data)
.
List collection names and stats.
name
(required, String) ... - The database name.opts
(optional, Object) ... Placeholder for future options.fn
(optional, Function) ... A response callback(err, data)
.
Collection stats
ns
(required, String) ... A namespace string, eg#{database_name}.#{collection_name}
opts
(optional, Object) ... Placeholder for future optionsfn
(optional, Function) ... A response callback(err, data)
Index details
ns
(required, String) ... A namespace string, eg#{database_name}.#{collection_name}
name
(required, String) ... The index nameopts
(optional, Object) ... Placeholder for future optionsfn
(optional, Function) ... A response callback(err, data)
Work with a single document.
ns
(required, String) ... A namespace string, eg#{database_name}.#{collection_name}
_id
(required, String) ... The document's_id
valueopts
(optional, Object) ... Placeholder for future optionsfn
(optional, Function) ... A response callback(err, data)
Run a query on ns
.
ns
(required, String) ... - A namespace string, eg#{database_name}.#{collection_name}
opts
(optional, Object) ... - Placeholder for future optionsfn
(optional, Function) ... - A response callback(err, data)
Run a count on ns
.
ns
(required, String) ... A namespace string, eg#{database_name}.#{collection_name}
opts
(optional, Object) ... - Optionsfn
(optional, Function) ... A response callback(err, data)
Run an aggregation pipeline on ns
.
ns
(required, String) ... A namespace string, eg#{database_name}.#{collection_name}
pipeline
(required, Array) ... - Agg pipeline to execute.opts
(optional, Object) ... - Optionsfn
(required, Function) ... A response callback(err, data)
Use resevoir sampling to get a slice of documents from a collection efficiently.
ns
(required, String) ... - A namespace string, eg#{database_name}.#{collection_name}
opts
(optional, Object) ... - Optionsfn
(required, Function) ... - A response callback(err, data)
Convenience to get 1 document via Client.prototype.sample
.
ns
(required, String) ... - A namespace string, eg#{database_name}.#{collection_name}
opts
(optional, Object) ... - Optionsfn
(required, Function) ... - A response callback(err, data)