Permalink
Browse files

BatchSize < 0 generally, not only -1

  • Loading branch information...
pavlobaron committed Apr 22, 2012
1 parent 7821b6a commit 65da589def005dcda7e1d5c33bc90c48fce4f92b
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/riak_mongo_riak.erl
View
@@ -115,10 +115,8 @@ find(#mongo_query{dbcoll=Bucket, selector=Selector, projector=Projection, batchs
if
BatchSize == 0 ->
Batch = ?DEFAULT_FIND_SIZE;
- BatchSize == -1 ->
- Batch = 1;
true ->
- Batch = BatchSize
+ Batch = abs(BatchSize)
end,
error_logger:info_msg("Find executed ~p, ~p, ~p~n", [Projection, CompiledQuery, Project]),
@@ -133,7 +131,7 @@ find(#mongo_query{dbcoll=Bucket, selector=Selector, projector=Projection, batchs
case cursor_get_results(CursorPID, Batch) of
{more, StartingFrom, Documents} ->
- if BatchSize == -1 ->
+ if BatchSize < 0 ->
CursorPID ! die,
{ok,
#mongo_reply{ startingfrom = StartingFrom,

0 comments on commit 65da589

Please sign in to comment.