class_docstr: Calls to :meth:`orion.core.io.database.AbstractDB.read_and_write`.
docstr: Should read and update a single entry in the collection.
docstr_tok: ["Should","read","and","update","a","single","entry","in","the","collection","."]
code: def test_read_and_write_one(self, orion_db, test_collection):
      """Should read and update a single entry in the collection."""
      # Make sure there is only one match
      documents = orion_db.read(
          "test_collection", {"unique_field": "unique1"}
      )
      assert len(documents) == 1
  
      # Find and update atomically
      loaded_config = orion_db.read_and_write(
          "test_collection",
          {"unique_field": "unique1"},
          {"field0": "lalala"},
      )
      test_collection[1]["field0"] = "lalala"
      assert loaded_config == test_collection[1]
  
imports: import pickle
  from datetime import datetime
  import pytest
  from orion.core.io.database import Database, DatabaseError, DuplicateKeyError
  from orion.core.io.database.ephemeraldb import EphemeralDB
  from orion.core.io.database.mongodb import MongoDB
  from orion.core.io.database.pickleddb import PickledDB
  from .conftest import insert_test_collection
label_desc: Use image node_id 1 for calling the TestReadAndWrite obj's underlying member method code with example usage: obj.test_read_and_write_one(orion_db, test_collection) without return types