diff --git a/mongodb/vibe/db/mongo/connection.d b/mongodb/vibe/db/mongo/connection.d index a039d8617..7d22b3a5c 100644 --- a/mongodb/vibe/db/mongo/connection.d +++ b/mongodb/vibe/db/mongo/connection.d @@ -502,7 +502,8 @@ final class MongoConnection { command["getMore"] = Bson(cursor_id); command["$db"] = Bson(database); command["collection"] = Bson(collection_name); - command["batchSize"] = Bson(nret); + if (nret > 0) + command["batchSize"] = Bson(nret); if (timeout != Duration.max && timeout.total!"msecs" < int.max) command["maxTimeMS"] = Bson(cast(int)timeout.total!"msecs");