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: Write new information to a collection. Perform insert or update.
  
  Parameters
  ----------
  collection_name: str
     A collection inside database, a table.
  data: dict or list of dicts
     New data that will **be inserted** or that will **update** entries.
  query: dict, optional
     Assumes an update operation: filter entries in collection to be updated.
  
  Returns
  -------
  int
      Number of new documents if no query, otherwise number of modified documents.
  
  Notes
  -----
  In the case of an insert operation, `data` variable will be updated
  to contain a unique *_id* key.
  
  In the case of an update operation, if `query` fails to find a
  document that matches, no operation is performed.
  
  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: ["Write","new","information","to","a","collection",".","Perform","insert","or","update",".","Parameters","--","--","--","--","--","collection_name",":","str","A","collection","inside","database",",","a","table",".","data",":","dict","or","list","of","dicts","New","data","that","will","*","*","be","inserted","*","*","or","that","will","*","*","update","*","*","entries",".","query",":","dict",",","optional","Assumes","an","update","operation",":","filter","entries","in","collection","to","be","updated",".","Returns","--","--","--","-","int","Number","of","new","documents","if","no","query",",","otherwise","number","of","modified","documents",".","Notes","--","--","-","In","the","case","of","an","insert","operation",",","`","data","`","variable","will","be","updated","to","contain","a","unique","*","_id","*","key",".","In","the","case","of","an","update","operation",",","if","`","query","`","fails","to","find","a","document","that","matches",",","no","operation","is","performed",".","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 write(self, collection_name, data, query=None):
      """Write new information to a collection. Perform insert or update.
  
      Parameters
      ----------
      collection_name: str
         A collection inside database, a table.
      data: dict or list of dicts
         New data that will **be inserted** or that will **update** entries.
      query: dict, optional
         Assumes an update operation: filter entries in collection to be updated.
  
      Returns
      -------
      int
          Number of new documents if no query, otherwise number of modified documents.
  
      Notes
      -----
      In the case of an insert operation, `data` variable will be updated
      to contain a unique *_id* key.
  
      In the case of an update operation, if `query` fails to find a
      document that matches, no operation is performed.
  
      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 9 for calling the Database obj's underlying member method code with example usage: obj.write(collection_name, data, query) without return types