def _refresh(self):
"""Refreshes the cursor with more data from the server.
Returns the length of self.__data after refresh. Will exit early if
self.__data is already non-empty. Raises OperationFailure when the
cursor cannot be refreshed due to an error on the query.
"""
if len(self.__data) or self.__killed:
return len(self.__data)
if self.__id: # Get More
dbname, collname = self.__ns.split('.', 1)
self.__send_message(
_GetMore(dbname,
collname,
self.__batch_size,
self.__id,
self.__collection.codec_options))
else: # Cursor id is zero nothing else to return
self.__killed = True
return len(self.__data)
command_cursor.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录