def get_api_exceptions(result_limit=50, sort_direction=pymongo.DESCENDING):
"""
Retrieve api exceptions.
Args:
result_limit: the maximum number of exceptions to return.
sort_direction: pymongo.ASCENDING or pymongo.DESCENDING
"""
db = api.common.get_conn()
results = db.exceptions.find({"visible": True}).sort([("time", sort_direction)]).limit(result_limit)
return list(results)
评论列表
文章目录