getCursorData method

  1. @override
void getCursorData(
  1. MongoReplyMessage replyMessage
)
override

Implementation

@override
void getCursorData(MongoReplyMessage replyMessage) {
  if (firstBatch) {
    firstBatch = false;
    var cursorMap =
        replyMessage.documents?.first['cursor'] as Map<String, dynamic>?;
    if (cursorMap != null) {
      cursorId = cursorMap['id'] as int;
      final firstBatch = cursorMap['firstBatch'] as List;
      items.addAll(List.from(firstBatch));
    }
  } else {
    super.getCursorData(replyMessage);
  }
}