We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b92263d commit 973f199Copy full SHA for 973f199
src/mongo/db/query/new_find.cpp
@@ -696,7 +696,7 @@ namespace mongo {
696
// collection is empty. Otherwise, the semantics of the tailable cursor is that the
697
// client will keep trying to read from it. So we'll keep it around.
698
Collection* collection = ctx.ctx().db()->getCollection(cq->ns());
699
- if (collection->numRecords() != 0) {
+ if (collection->numRecords() != 0 && pq.getNumToReturn() != 1) {
700
saveClientCursor = true;
701
}
702
0 commit comments