Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit c363cf1

Browse files
committed
Use cached db instances
1 parent 34fbf48 commit c363cf1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/fetch.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function attach(anything, done) {
2828
function getIndexes(done, results) {
2929
var client = results.client;
3030
var ns = mongodbNS(results.namespace);
31-
client.db(ns.database, { returnNonCachedInstance: true }).collection(ns.collection).indexes(function(err, indexes) {
31+
client.db(ns.database).collection(ns.collection).indexes(function(err, indexes) {
3232
if (err) {
3333
done(err);
3434
}
@@ -52,7 +52,7 @@ function getIndexStats(done, results) {
5252
{ $indexStats: { } },
5353
{ $project: { name: 1, usageHost: '$host', usageCount: '$accesses.ops', usageSince: '$accesses.since' } }
5454
];
55-
var collection = client.db(ns.database, { returnNonCachedInstance: true }).collection(ns.collection);
55+
var collection = client.db(ns.database).collection(ns.collection);
5656
collection.aggregate(pipeline, { cursor: {}}).toArray(function(err, res) {
5757
if (err) {
5858
if (isNotAuthorizedError(err)) {
@@ -86,7 +86,7 @@ function getIndexStats(done, results) {
8686
function getIndexSizes(done, results) {
8787
var client = results.client;
8888
var ns = mongodbNS(results.namespace);
89-
client.db(ns.database, { returnNonCachedInstance: true }).collection(ns.collection).stats(function(err, res) {
89+
client.db(ns.database).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 {}.');

0 commit comments

Comments
 (0)