def search_entries_by_id(self, id):
"""Search For Entries created on the specified Date in the Entries_Table
Args:
id(string): the objectID you are searching for
Return:
result(collection): the search result
"""
entries_table = self.db["Entries_Table"]
try:
return entries_table.find(
{"_id": ObjectId(id)})
except errors.ServerSelectionTimeoutError:
print('ERROR : No connection could be made because'
' the target machine actively refused it')
return True
return False
评论列表
文章目录