GridFSStore collection has no database attribute
Any atomate2 TaskDocument larger than the document limit cannot spill into gridfs additional stores successfully because the gridfs collection has no database property

Traceback (truncated):
```
Traceback (most recent call last):
  File "/home/pmangana/src/atomate2/a2a.py", line 124, in update_store
    s.update(data, key="uuid")
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/jobflow/core/store.py", line 325, in update
    self.docs_store.update(dict_docs, key=key)
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/stores/mongolike.py", line 487, in update
    raise e
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/stores/mongolike.py", line 475, in update
    self._collection.bulk_write(requests, ordered=False)
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/pymongo/_csot.py", line 105, in csot_wrapper
    return func(self, *args, **kwargs)
....
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/pymongo/message.py", line 1162, in _do_batched_op_msg
    return _batched_op_msg(operation, command, docs, ack, opts, ctx)
pymongo.errors.DocumentTooLarge: update command document too large

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pmangana/src/atomate2/a2a.py", line 97, in worker
    update_store(store=store, data=data)
  File "/home/pmangana/src/atomate2/a2a.py", line 123, in update_store
    with store as s:
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/core/store.py", line 351, in __exit__
    self.close()
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/jobflow/core/store.py", line 116, in close
    additional_store.close()
  File "/depot/amannodi/apps/bigconda/envs/a2/lib/python3.10/site-packages/maggma/stores/gridfs.py", line 450, in close
    self._collection.database.client.close()
AttributeError: 'GridFS' object has no attribute 'database'
```

https://github.com/materialsproject/maggma/blob/0680fa9508fe29e8e84963d54662a6c9e3e94d55/src/maggma/stores/gridfs.py#L450

versions:
`db> db.version() `
6.0.2

I deployed the official docker container on an enterprise server.

`conda list` (truncated)
`jobflow                   0.1.7              pyhd8ed1ab_0    conda-forge`
`maggma                    0.49.4             pyhd8ed1ab_0    conda-forge`
`atomate2                  0.0.1.post912+g1fd2322          pypi_0    pypi` (my fork main)
`pymongo                   4.2.0                    pypi_0    pypi`

In context, I've written a very simple script to try backfilling a database with legacy vasp runs, obviously there's some shortcomings to this, but this cannot be one of them. Very new to all this. Advice appreciated.
diff --git a/requirements.txt b/requirements.txt
index 3ccbded2..3568d96a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -15,7 +15,7 @@ uvicorn==0.18.3
 sshtunnel==0.4.0
 msgpack==1.0.3
 msgpack-python==0.5.6
-orjson==3.8.0
+orjson==3.8.14
 boto3==1.24.42
 python-dateutil==2.8.2
 pydantic
diff --git a/src/maggma/stores/gridfs.py b/src/maggma/stores/gridfs.py
index 720776b4..2374d208 100644
--- a/src/maggma/stores/gridfs.py
+++ b/src/maggma/stores/gridfs.py
@@ -2,7 +2,7 @@
 """
 Module containing various definitions of Stores.
 Stores are a default access pattern to data and provide
-various utillities
+various utilities
 """
 
 import copy
@@ -81,7 +81,7 @@ class GridFSStore(Store):
         self.port = port
         self.username = username
         self.password = password
-        self._coll = None  # type: Any
+        self._coll: Any = None
         self.compression = compression
         self.ensure_metadata = ensure_metadata
         self.searchable_fields = [] if searchable_fields is None else searchable_fields
@@ -162,7 +162,9 @@ class GridFSStore(Store):
     def _collection(self):
         """Property referring to underlying pymongo collection"""
         if self._coll is None:
-            raise StoreError("Must connect Mongo-like store before attemping to use it")
+            raise StoreError(
+                "Must connect Mongo-like store before attempting to use it"
+            )
         return self._coll
 
     @property
@@ -244,7 +246,6 @@ class GridFSStore(Store):
             if properties is not None and prop_keys.issubset(set(doc.keys())):
                 yield {p: doc[p] for p in properties if p in doc}
             else:
-
                 metadata = doc.get("metadata", {})
 
                 data = self._collection.find_one(
@@ -354,7 +355,7 @@ class GridFSStore(Store):
 
     def ensure_index(self, key: str, unique: Optional[bool] = False) -> bool:
         """
-        Tries to create an index and return true if it suceeded
+        Tries to create an index and return true if it succeeded
         Currently operators on the GridFS files collection
         Args:
             key: single key to index
@@ -447,7 +448,8 @@ class GridFSStore(Store):
             self._collection.delete(_id)
 
     def close(self):
-        self._collection.database.client.close()
+        self._files_store.close()
+        self._coll = None
         if self.ssh_tunnel is not None:
             self.ssh_tunnel.stop()
 
@@ -507,7 +509,7 @@ class GridFSURIStore(GridFSStore):
             self.database = database
 
         self.collection_name = collection_name
-        self._coll = None  # type: Any
+        self._coll: Any = None
         self.compression = compression
         self.ensure_metadata = ensure_metadata
         self.searchable_fields = [] if searchable_fields is None else searchable_fields
diff --git a/src/maggma/stores/mongolike.py b/src/maggma/stores/mongolike.py
index 4633d422..2ee5578a 100644
--- a/src/maggma/stores/mongolike.py
+++ b/src/maggma/stores/mongolike.py
@@ -10,7 +10,7 @@ from ruamel import yaml
 from itertools import chain, groupby
 from socket import socket
 import warnings
-from typing import Dict, Iterator, List, Optional, Tuple, Union
+from typing import Dict, Iterator, List, Optional, Tuple, Union, Any
 
 import mongomock
 import orjson
@@ -704,6 +704,8 @@ class JSONStore(MemoryStore):
         self,
         paths: Union[str, List[str]],
         read_only: bool = True,
+        serialization_option: Optional[int] = None,
+        serialization_default: Any = None,
         **kwargs,
     ):
         """
@@ -720,6 +722,10 @@ class JSONStore(MemoryStore):
                        Note that when read_only=False, JSONStore only supports a single JSON
                        file. If the file does not exist, it will be automatically created
                        when the JSONStore is initialized.
+            serialization_option:
+                option that will be passed to the orjson.dump when saving to the json the file.
+            serialization_default:
+                default that will be passed to the orjson.dump when saving to the json the file.
         """
         paths = paths if isinstance(paths, (list, tuple)) else [paths]
         self.paths = paths
@@ -755,6 +761,8 @@ class JSONStore(MemoryStore):
                 f.write(bytesdata.decode("utf-8"))
 
         self.default_sort = None
+        self.serialization_option = serialization_option
+        self.serialization_default = serialization_default
 
         super().__init__(**kwargs)
 
@@ -838,7 +846,11 @@ class JSONStore(MemoryStore):
             data = [d for d in self.query()]
             for d in data:
                 d.pop("_id")
-            bytesdata = orjson.dumps(data)
+            bytesdata = orjson.dumps(
+                data,
+                option=self.serialization_option,
+                default=self.serialization_default,
+            )
             f.write(bytesdata.decode("utf-8"))
 
     def __hash__(self):
diff --git a/tests/stores/test_gridfs.py b/tests/stores/test_gridfs.py
index a6c682e6..65d6540e 100644
--- a/tests/stores/test_gridfs.py
+++ b/tests/stores/test_gridfs.py
@@ -6,6 +6,7 @@ from datetime import datetime
 import numpy as np
 import numpy.testing.utils as nptu
 import pytest
+from maggma.core import StoreError
 
 from maggma.stores import GridFSStore, MongoStore
 from maggma.stores.gridfs import files_collection_fields, GridFSURIStore
@@ -218,7 +219,7 @@ def test_index(gridfsstore):
 
 def test_gfs_metadata(gridfsstore):
     """
-    Ensure metadata is put back in the docuemnt
+    Ensure metadata is put back in the document
     """
     tic = datetime(2018, 4, 12, 16)
 
@@ -244,7 +245,6 @@ def test_gridfsstore_from_launchpad_file(lp_file):
 
 
 def test_searchable_fields(gridfsstore):
-
     tic = datetime(2018, 4, 12, 16)
 
     data = [
@@ -259,7 +259,6 @@ def test_searchable_fields(gridfsstore):
 
 
 def test_additional_metadata(gridfsstore):
-
     tic = datetime(2018, 4, 12, 16)
 
     data = [
@@ -299,3 +298,12 @@ def test_gridfs_uri_dbname_parse():
     uri_with_db = "mongodb://uuu:xxxx@host:27017"
     with pytest.raises(ConfigurationError):
         GridFSURIStore(uri_with_db, "test")
+
+
+def test_close(gridfsstore):
+    assert gridfsstore.query_one() is None
+    gridfsstore.close()
+    with pytest.raises(StoreError):
+        gridfsstore.query_one()
+    # reconnect to allow the drop of the collection in the fixture
+    gridfsstore.connect()
diff --git a/tests/stores/test_mongolike.py b/tests/stores/test_mongolike.py
index d037ce77..ddc30dca 100644
--- a/tests/stores/test_mongolike.py
+++ b/tests/stores/test_mongolike.py
@@ -1,3 +1,4 @@
+import orjson
 import os
 import shutil
 from datetime import datetime
@@ -43,7 +44,6 @@ def memorystore():
 
 @pytest.fixture
 def jsonstore(test_dir):
-
     files = []
     for f in ["a.json", "b.json"]:
         files.append(test_dir / "test_set" / f)
@@ -503,6 +503,28 @@ def test_json_store_writeable(test_dir):
             update_json_file_mock.assert_not_called()
 
 
+def test_jsonstore_orjson_options(test_dir):
+    class SubFloat(float):
+        pass
+
+    with ScratchDir("."):
+        jsonstore = JSONStore("d.json", read_only=False)
+        jsonstore.connect()
+        with pytest.raises(orjson.JSONEncodeError):
+            jsonstore.update({"wrong_field": SubFloat(1.1), "task_id": 3})
+        jsonstore.close()
+
+        jsonstore = JSONStore(
+            "a.json",
+            read_only=False,
+            serialization_option=None,
+            serialization_default=lambda x: "test",
+        )
+        jsonstore.connect()
+        jsonstore.update({"wrong_field": SubFloat(1.1), "task_id": 3})
+        jsonstore.close()
+
+
 def test_jsonstore_last_updated(test_dir):
     # files = []
     # for f in ["a.json", "b.json"]:
['src/maggma/stores/gridfs.py', 'tests/stores/test_gridfs.py', 'requirements.txt', 'tests/stores/test_mongolike.py', 'src/maggma/stores/mongolike.py']