diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-09-24 16:27:58 -0400 |
---|---|---|
committer | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-10-04 11:22:05 -0400 |
commit | c589abf31b748d0f13e710d8d59394b65ab6891d (patch) | |
tree | 637288a6b560f8906bc0dd6ff3bf1b55eb709b79 /src/mongo/db/clientcursor.cpp | |
parent | f9436146f64ad7caa2ce525c1d75a85f918d68c0 (diff) | |
download | mongo-c589abf31b748d0f13e710d8d59394b65ab6891d.tar.gz |
SERVER-37005 Add fields to GenericCursor
Diffstat (limited to 'src/mongo/db/clientcursor.cpp')
-rw-r--r-- | src/mongo/db/clientcursor.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp index 1c747d07998..756f1fbc7eb 100644 --- a/src/mongo/db/clientcursor.cpp +++ b/src/mongo/db/clientcursor.cpp @@ -91,7 +91,8 @@ ClientCursor::ClientCursor(ClientCursorParams params, _queryOptions(params.queryOptions), _exec(std::move(params.exec)), _operationUsingCursor(operationUsingCursor), - _lastUseDate(now) { + _lastUseDate(now), + _createdDate(now) { invariant(_cursorManager); invariant(_exec); invariant(_operationUsingCursor); @@ -133,12 +134,15 @@ GenericCursor ClientCursor::toGenericCursor() const { GenericCursor gc; gc.setCursorId(cursorid()); gc.setNs(nss()); - gc.setNDocsReturned(pos()); + gc.setNDocsReturned(nReturnedSoFar()); gc.setTailable(isTailable()); gc.setAwaitData(isAwaitData()); gc.setNoCursorTimeout(isNoTimeout()); gc.setOriginatingCommand(getOriginatingCommandObj()); gc.setLsid(getSessionId()); + gc.setLastAccessDate(getLastUseDate()); + gc.setCreatedDate(getCreatedDate()); + gc.setNBatchesReturned(getNBatches()); if (auto opCtx = _operationUsingCursor) { gc.setOperationUsingCursorId(opCtx->getOpID()); } |