Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bugfix for findOpt(Col,[],...)

  • Loading branch information...
commit 5bec60832873e2d852c4c189cd7e3e4f65284813 1 parent 516b646
@SergejJurecko authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 mongoapi.erl
View
7 mongoapi.erl
@@ -223,7 +223,12 @@ find(Query, Selector, From, Limit) ->
% SortBy: {key, Val} or a list of keyval tuples -> {i,1} (1 = ascending, -1 = descending)
% Hint: [{Key,Val}] -> [{#mydoc.i,1}]
findOpt(Col, Query, Selector, Opts, From, Limit) when is_list(Query) ->
- {_,Q} = translateopts(false,undefined, Opts,[{<<"query">>, Query}]),
+ case Query of
+ [] ->
+ {_,Q} = translateopts(false,undefined, Opts,[{<<"query">>, {bson,<<>>}}]);
+ _ ->
+ {_,Q} = translateopts(false,undefined, Opts,[{<<"query">>, Query}])
+ end,
find(Col, Q, Selector, From, Limit);
% SortBy examples: {#mydoc.name, 1}, [{#mydoc.i, 1},{#mydoc.name,-1}]
% Hint example: #mydoc.name
Please sign in to comment.
Something went wrong with that request. Please try again.