Skip to content

Commit 75f658f

Browse files
committed
minor modification
1 parent d95733b commit 75f658f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

filexdb/database.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def __init__(self, db_name: str, data_dir=None, mode="binary"):
1919
:param db_name: Name of Database without file extension.
2020
:param data_dir: Where the Database will be stored.
2121
"""
22-
self._database = {}
2322
self._db_name = db_name
2423
self._data_dir = data_dir
2524

@@ -29,6 +28,10 @@ def __init__(self, db_name: str, data_dir=None, mode="binary"):
2928
elif mode == "json":
3029
self._file_handler = JsonFileIO(self._db_name, self._data_dir)
3130

31+
# Getting whole database.
32+
self._database = self._show()
33+
34+
3235
def collection(self, col_name: str) -> Collection:
3336
"""
3437
Creates a brand-new Collection if the Collection is not exists.
@@ -65,7 +68,8 @@ def export(self, _file_name, _file_dir=None, _mode="json"):
6568
:return: None.
6669
"""
6770

68-
e = Export(self._show(), _file_name, _file_dir, _mode)
71+
e = Export(self._database, _file_name, _file_dir, _mode)
72+
6973

7074
def _show(self) -> Document:
7175
"""

0 commit comments

Comments
 (0)