class_docstr: The Sacred Mongo client allows to retrieve results from experiments tracked
  with Sacred from MongoDB.
docstr: Args:
      experiment: The name(s) of the experiment(s) for which to query individual runs.
      only_completed: Whether only completed jobs should be returned.
      host: The hostname of the server where the MongoDB is running.
      port: The port where the MongoDB is reachable.
      database: The name of the database where Sacred experiments are stored.
docstr_tok: ["Args",":","experiment",":","The","name","(","s",")","of","the","experiment","(","s",")","for","which","to","query","individual","runs",".","only_completed",":","Whether","only","completed","jobs","should","be","returned",".","host",":","The","hostname","of","the","server","where","the","MongoDB","is","running",".","port",":","The","port","where","the","MongoDB","is","reachable",".","database",":","The","name","of","the","database","where","Sacred","experiments","are","stored","."]
code: def __init__(
      self,
      experiment: Union[str, List[str]],
      host: str = "localhost",
      port: int = 27017,
      database: str = "sacred",
      only_completed: bool = True,
  ):
      """
      Args:
          experiment: The name(s) of the experiment(s) for which to query individual runs.
          only_completed: Whether only completed jobs should be returned.
          host: The hostname of the server where the MongoDB is running.
          port: The port where the MongoDB is reachable.
          database: The name of the database where Sacred experiments are stored.
      """
      # Initialize Mongo client
      client = pymongo.MongoClient(host, port)
      self.db = client[database]
      self.fs = gridfs.GridFS(self.db)
  
      # Initialize base query
      if isinstance(experiment, list):
          self.base_query = {"config.experiment": {"$in": experiment}}
      else:
          self.base_query = {"config.experiment": experiment}
  
      if only_completed:
          self.base_query.update({"status": "COMPLETED"})
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/analysis/tracking/client.py
imports: from typing import Any, Dict, Iterator, List, Optional, Union
  import gridfs
  import pymongo
  from .experiment import SacredExperiment
label_desc: Use image node_id 1 to create a new SacredMongoClient object  with example: obj = SacredMongoClient(experiment, host, port, database, only_completed)