Merge pull request #488 from EverythingMe/fix/mongo-support-sandbox

Fix: Drop database name check in MongoDB queries  to support sandboxed environments
This commit is contained in:
Arik Fraimovich
2015-07-14 08:56:47 +03:00

View File

@@ -162,10 +162,7 @@ class MongoDB(BaseQueryRunner):
else:
db_connection = pymongo.MongoClient(self.configuration["connectionString"])
if self.db_name not in db_connection.database_names():
return None, "Unknown database name '%s'" % self.db_name
db = db_connection[self.db_name ]
db = db_connection[self.db_name]
logger.debug("mongodb connection string: %s", self.configuration['connectionString'])
logger.debug("mongodb got query: %s", query)
@@ -226,9 +223,6 @@ class MongoDB(BaseQueryRunner):
columns = []
rows = []
error = None
json_data = None
cursor = None
if q or (not q and not aggregate):
if s: