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

Commit 13cfedf

Browse files
authored
COMPASS 171: Also need to bust the DB cache (#54)
1 parent 19eb5ce commit 13cfedf

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
@@ -34,7 +34,7 @@ function attach(anything, done) {
3434
function getIndexes(done, results) {
3535
var db = results.db;
3636
var ns = mongodbNS(results.namespace);
37-
db.db(ns.database, {readPreference: {mode: READ}}).collection(ns.collection).indexes(function(err, indexes) {
37+
db.db(ns.database, {readPreference: {mode: READ}, returnNonCachedInstance: true}).collection(ns.collection).indexes(function(err, indexes) {
3838
if (err) {
3939
done(err);
4040
}
@@ -58,7 +58,7 @@ function getIndexStats(done, results) {
5858
{ $indexStats: { } },
5959
{ $project: { name: 1, usageHost: '$host', usageCount: '$accesses.ops', usageSince: '$accesses.since' } }
6060
];
61-
var collection = db.db(ns.database, {readPreference: {mode: READ}}).collection(ns.collection);
61+
var collection = db.db(ns.database, {readPreference: {mode: READ}, returnNonCachedInstance: true}).collection(ns.collection);
6262
collection.aggregate(pipeline, function(err, res) {
6363
if (err) {
6464
if (isNotAuthorizedError(err)) {
@@ -92,7 +92,7 @@ function getIndexStats(done, results) {
9292
function getIndexSizes(done, results) {
9393
var db = results.db;
9494
var ns = mongodbNS(results.namespace);
95-
db.db(ns.database, {readPreference: {mode: READ}}).collection(ns.collection).stats(function(err, res) {
95+
db.db(ns.database, {readPreference: {mode: READ}, returnNonCachedInstance: true}).collection(ns.collection).stats(function(err, res) {
9696
if (err) {
9797
if (isNotAuthorizedError(err)) {
9898
debug('Not authorized to get collection stats. Returning default for indexSizes {}.');

0 commit comments

Comments
 (0)