class_docstr: Service that controls the underlying MongoDB database.
class_docstr_tok: ["Service","that","controls","the","underlying","MongoDB","database","."]
code: def command(self):
      database_dir = focn.load_config().database_dir
      log_path = os.path.join(database_dir, "log", "mongo.log")
  
      args = [
          DatabaseService.find_mongod(),
          "--dbpath",
          database_dir,
          "--logpath",
          log_path,
          "--port",
          "0",
      ]
      if not sys.platform.startswith("win"):
          args.append("--nounixsocket")
  
      try:
          etau.ensure_dir(database_dir)
      except:
          raise PermissionError(
              "Database directory `%s` cannot be written to"
              % database_dir
          )
  
      try:
          etau.ensure_basedir(log_path)
  
          if not os.path.isfile(log_path):
              etau.ensure_empty_file(log_path)
      except:
          raise PermissionError(
              "Database log path `%s` cannot be written to" % log_path
          )
  
      if focx._get_context() == focx._COLAB:
          return ["sudo"] + args
  
      if focx._get_context() == focx._DATABRICKS:
          return ["sudo"] + args
  
      return args
  
imports: import logging
  import os
  import subprocess
  import sys
  import psutil
  import requests
  from retrying import retry
  import eta.core.utils
  import fiftyone.constants
  import fiftyone.core.config
  import fiftyone.core.context
  import fiftyone.service.util
label_desc: Use image node_id 1 for calling the DatabaseService obj's underlying member method code with example usage: obj.command() and returns: args, unknown, unknown