Allow callers to specify output attributes for mongodb() and add a docstring.