From 3b21251d506810f6e79e9820cc0f649ce3244fbe Mon Sep 17 00:00:00 2001 From: 17bit <58285040+17bit@users.noreply.github.com> Date: Sun, 14 Feb 2021 23:16:40 +0900 Subject: [PATCH] fix: isFilter fix: https://github.com/juicycleff/casbin-mongodb-adapter/issues/6 TypeError: this.adapter.isFiltered is not a function --- src/lib/adapter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/adapter.ts b/src/lib/adapter.ts index 2199cd2..0006ce2 100644 --- a/src/lib/adapter.ts +++ b/src/lib/adapter.ts @@ -37,7 +37,7 @@ export class MongoAdapter implements Adapter { return a; } - public isFiltered: boolean = false; + public useFilter: boolean = false; private readonly dbName: string; private readonly mongoClient: MongoClient; @@ -57,7 +57,7 @@ export class MongoAdapter implements Adapter { // Cache the mongo uri and db name for later use this.dbName = dbName; this.collectionName = collectionName; - this.isFiltered = filtered; + this.useFilter = filtered; try { // Create a new MongoClient @@ -92,7 +92,7 @@ export class MongoAdapter implements Adapter { try { let lines; - if (this.isFiltered) { + if (this.useFilter) { lines = await this.getCollection() .find(filter) .toArray();