DBHandler.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:CaptsLog 作者: jaehoonhwang 项目源码 文件源码
def search_entries_by_title(self, title):
        """Search For a Specified Title in the Entries_Table

        Args:
            title(str): the title you are searching for

        Return:
            result(collection): the search result

        """

        entries_table = self.db["Entries_Table"]
        try:
            result = entries_table.find_one({"Title": title})
            return result
        except errors.ServerSelectionTimeoutError:
            print('ERROR : No connection could be made because'
                  ' the target machine actively refused it')
            return False
            # TODO Modify to allow multiple results using find(),
            # TODO also find similar results which are not exact matches
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号