From f7df6e0cdcdcd0b6036a25c842dd23319be0dffb Mon Sep 17 00:00:00 2001 From: Weng Kham <39992484+knzshirox@users.noreply.github.com> Date: Tue, 14 Apr 2020 16:47:14 +0800 Subject: [PATCH] Fix test connection on mongodb datasource (#4785) Co-authored-by: Weng Kham Kan --- redash/query_runner/mongodb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redash/query_runner/mongodb.py b/redash/query_runner/mongodb.py index 7b2bb8420..7a8a224e4 100644 --- a/redash/query_runner/mongodb.py +++ b/redash/query_runner/mongodb.py @@ -195,7 +195,7 @@ class MongoDB(BaseQueryRunner): if not db.command("connectionStatus")["ok"]: raise Exception("MongoDB connection error") - return db_connection[self.db_name] + return db def _merge_property_names(self, columns, document):