diff --git a/source/MongoDB/Cursor_1.cs b/source/MongoDB/Cursor_1.cs index 88f24703..1781e4cb 100644 --- a/source/MongoDB/Cursor_1.cs +++ b/source/MongoDB/Cursor_1.cs @@ -221,11 +221,6 @@ public Cursor(ISerializationFactory serializationFactory, Connection connection, if(_reply == null) throw new InvalidOperationException("Expecting reply but get null"); - //if(_limit < 0) - //_limit = _limit * -1; - - Id = _reply.CursorId; - foreach(var document in _reply.Documents) yield return document; } @@ -329,7 +324,11 @@ private void KillCursor(long cursorId) try { - return _connection.SendTwoWayMessage(message, readerSettings); + var reply = _connection.SendTwoWayMessage(message, readerSettings); + + Id = reply.CursorId; + + return reply; } catch(IOException exception) {