Skip to content
Snippets Groups Projects
Commit 94db2cfa authored by Martin Bauer's avatar Martin Bauer
Browse files

ParameterStudy database: mongodb backend

parent fdc7f2f1
No related merge requests found
......@@ -41,7 +41,14 @@ class Database(object):
pass
def __init__(self, file):
self.backend = blitzdb.FileBackend(file)
if file.startswith("mongo://"):
from pymongo import MongoClient
dbName = file[len("mongo://"):]
c = MongoClient()
self.backend = blitzdb.MongoBackend(c[dbName])
else:
self.backend = blitzdb.FileBackend(file)
self.backend.autocommit = True
@staticmethod
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment