【mongo】查询超时处理

使用no_cursor_timeout

            collection = self.db[tb_name]
            cols = collection.find(no_cursor_timeout=True)
            for col in cols:
                # do something
            cols.close()

posted @ 2018-09-03 13:33  匡子语  阅读(...)  评论(...编辑  收藏