class_docstr: Base class for database framework wrappers.
  
  Attributes
  ----------
  host: str
     It can be either:
        1. Known hostname or IP address in which database server resides.
        2. URI: A database framework specific connection string.
  name: str
     Name of database containing experiments.
  port: int
     Port that database server listens to for requests.
  username: str
      Name of user with write/read permissions to database with name `name`.
  password: str
      Secret phrase of user, `username`.
docstr: Read a collection's document and update the found document.
  
  If many documents are found, the first one is selected.
  
  Returns the updated document, or None if nothing found.
  
  Parameters
  ----------
  collection_name: str
     A collection inside database, a table.
  query: dict
     Filter entries in collection.
  data: dict or list of dicts
     New data that will **update** the entry.
  selection: dict, optional
     Elements of matched entries to return, the projection.
  
  Returns
  -------
  dict or None
      Updated first matched document or None if nothing found
  
  Raises
  ------
  DuplicateKeyError
      If the operation is creating duplicate keys in two different documents. Only occurs if
      the keys have unique indexes. See :meth:`Database.ensure_index` for more information
      about indexes.
docstr_tok: ["Read","a","collection","'s","document","and","update","the","found","document",".","If","many","documents","are","found",",","the","first","one","is","selected",".","Returns","the","updated","document",",","or","None","if","nothing","found",".","Parameters","--","--","--","--","--","collection_name",":","str","A","collection","inside","database",",","a","table",".","query",":","dict","Filter","entries","in","collection",".","data",":","dict","or","list","of","dicts","New","data","that","will","*","*","update","*","*","the","entry",".","selection",":","dict",",","optional","Elements","of","matched","entries","to","return",",","the","projection",".","Returns","--","--","--","-","dict","or","None","Updated","first","matched","document","or","None","if","nothing","found","Raises","--","--","--","DuplicateKeyError","If","the","operation","is","creating","duplicate","keys","in","two","different","documents",".","Only","occurs","if","the","keys","have","unique","indexes",".","See",":","meth",":","`","Database.ensure_index","`","for","more","information","about","indexes","."]
code: def read_and_write(
      self, collection_name, query, data, selection=None
  ):
      """Read a collection's document and update the found document.
  
      If many documents are found, the first one is selected.
  
      Returns the updated document, or None if nothing found.
  
      Parameters
      ----------
      collection_name: str
         A collection inside database, a table.
      query: dict
         Filter entries in collection.
      data: dict or list of dicts
         New data that will **update** the entry.
      selection: dict, optional
         Elements of matched entries to return, the projection.
  
      Returns
      -------
      dict or None
          Updated first matched document or None if nothing found
  
      Raises
      ------
      DuplicateKeyError
          If the operation is creating duplicate keys in two different documents. Only occurs if
          the keys have unique indexes. See :meth:`Database.ensure_index` for more information
          about indexes.
  
      """
  
imports: import logging
  from abc import abstractmethod, abstractproperty
  from orion.core.utils import Factory, GenericFactory
label_desc: Use image node_id 11 for calling the Database obj's underlying member method code with example usage: obj.read_and_write(collection_name, query, data, selection) without return types