@@ -26,9 +26,9 @@ function attach(anything, done) {
2626 * @param {object } results results from async.auto
2727 */
2828function getIndexes ( done , results ) {
29- var db = results . db ;
29+ var client = results . client ;
3030 var ns = mongodbNS ( results . namespace ) ;
31- db . db ( ns . database , { returnNonCachedInstance : true } ) . collection ( ns . collection ) . indexes ( function ( err , indexes ) {
31+ client . db ( ns . database , { returnNonCachedInstance : true } ) . collection ( ns . collection ) . indexes ( function ( err , indexes ) {
3232 if ( err ) {
3333 done ( err ) ;
3434 }
@@ -46,13 +46,13 @@ function getIndexes(done, results) {
4646 * @param {object } results results from async.auto
4747 */
4848function getIndexStats ( done , results ) {
49- var db = results . db ;
49+ var client = results . client ;
5050 var ns = mongodbNS ( results . namespace ) ;
5151 var pipeline = [
5252 { $indexStats : { } } ,
5353 { $project : { name : 1 , usageHost : '$host' , usageCount : '$accesses.ops' , usageSince : '$accesses.since' } }
5454 ] ;
55- var collection = db . db ( ns . database , { returnNonCachedInstance : true } ) . collection ( ns . collection ) ;
55+ var collection = client . db ( ns . database , { returnNonCachedInstance : true } ) . collection ( ns . collection ) ;
5656 collection . aggregate ( pipeline , { cursor : { } } ) . toArray ( function ( err , res ) {
5757 if ( err ) {
5858 if ( isNotAuthorizedError ( err ) ) {
@@ -84,9 +84,9 @@ function getIndexStats(done, results) {
8484 */
8585
8686function getIndexSizes ( done , results ) {
87- var db = results . db ;
87+ var client = results . client ;
8888 var ns = mongodbNS ( results . namespace ) ;
89- db . db ( ns . database , { returnNonCachedInstance : true } ) . collection ( ns . collection ) . stats ( function ( err , res ) {
89+ client . db ( ns . database , { returnNonCachedInstance : true } ) . collection ( ns . collection ) . stats ( function ( err , res ) {
9090 if ( err ) {
9191 if ( isNotAuthorizedError ( err ) ) {
9292 debug ( 'Not authorized to get collection stats. Returning default for indexSizes {}.' ) ;
@@ -124,13 +124,13 @@ function combineStatsAndIndexes(done, results) {
124124 * @param {String } namespace namespace for which to get indexes
125125 * @param {Function } done callback
126126 */
127- function getIndexDetails ( db , namespace , done ) {
127+ function getIndexDetails ( client , namespace , done ) {
128128 var tasks = {
129- db : attach . bind ( null , db ) ,
129+ client : attach . bind ( null , client ) ,
130130 namespace : attach . bind ( null , namespace ) ,
131- getIndexes : [ 'db ' , 'namespace' , getIndexes ] ,
132- getIndexStats : [ 'db ' , 'namespace' , getIndexStats ] ,
133- getIndexSizes : [ 'db ' , 'namespace' , getIndexSizes ] ,
131+ getIndexes : [ 'client ' , 'namespace' , getIndexes ] ,
132+ getIndexStats : [ 'client ' , 'namespace' , getIndexStats ] ,
133+ getIndexSizes : [ 'client ' , 'namespace' , getIndexSizes ] ,
134134 indexes : [ 'getIndexes' , 'getIndexStats' , 'getIndexSizes' , combineStatsAndIndexes ]
135135 } ;
136136
0 commit comments