code: def user_exists(name, user=None, password=None, host=None, port=None,
                  database='admin', authdb=None):
      '''
      Checks if a user exists in MongoDB
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' mongodb.user_exists <name> <user> <password> <host> <port> <database>
      '''
      users = user_list(user, password, host, port, database, authdb)
  
      if isinstance(users, six.string_types):
          return 'Failed to connect to mongo database'
  
      for user in users:
          if name == dict(user).get('user'):
              return True
  
      return Falsf user_exists(name, user=None, password=None, host=None, port=None,
                  database='admin', authdb=None):
      '''
      Checks if a user exists in MongoDB
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' mongodb.user_exists <name> <user> <password> <host> <port> <database>
      '''
      users = user_list(user, password, host, port, database, authdb)
  
      if isinstance(users, six.string_types):
          return 'Failed to connect to mongo database'
  
      for user in users:
          if name == dict(user).get('user'):
              return True
  
      return False
docs: Checks if a user exists in MongoDB
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' mongodb.user_exists <name> <user> <password> <host> <port> <database>