Skip to content

Commit

Permalink
Ignore old documents (#221)
Browse files Browse the repository at this point in the history
Ignoring old Dashboard and ApprenticeshipProgrammes docs from being copied over to new QueryStore
  • Loading branch information
Lee Wadhams authored Sep 3, 2018
1 parent 11e96a8 commit 691fdbe
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ function millisToMinutesAndSeconds(millis) {
db.queryStore.deleteMany({ "viewType": vt });
});

let queryViewDocs = db.queryViews.find().toArray();
/* Excluding dashboard documents as they have been renamed and will be re-generated */
/* Excluding ApprenticeshipProgrammes as they have been moved to ReferenceData collection */
let queryViewDocs = db.queryViews.find({ $and: [{ "viewType": { $ne: "Dashboard"}}, { "viewType": { $ne: "ApprenticeshipProgrammes"}}]}).toArray();

uniqueQueryViewsViewTypes.forEach(vt => {
print(`queryViews collection has ${db.queryViews.find({}).toArray().filter(doc => doc.viewType === vt).length} ${vt} documents.`);
Expand Down

0 comments on commit 691fdbe

Please sign in to comment.