Permalink
Browse files

Added near operator

  • Loading branch information...
1 parent d8e5d0a commit 5684ea3f7993bf2173af9addd00c85322dfc8c67 RUDD, Brett committed Jun 19, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/emongo.erl
View
@@ -555,14 +555,16 @@ transform_selector([{Key, [{_,_}|_]=Vals}|Tail], Acc) ->
{<<"$in">>, {array, Val}};
nin when is_list(Val) ->
{<<"$nin">>, {array, Val}};
- mod when is_list(Val), length(Val) == 2 ->
+ mod when is_list(Val), length(Val) == 2 ->
{<<"$mod">>, {array, Val}};
all when is_list(Val) ->
{<<"$all">>, {array, Val}};
size when is_integer(Val) ->
{<<"$size">>, Val};
exists when is_boolean(Val) ->
{<<"$exists">>, Val};
+ near when is_list(Val) ->
+ {<<"$near">>, {array, Val}};
_ ->
{Operator, Val}
end || {Operator, Val} <- Vals],

0 comments on commit 5684ea3

Please sign in to comment.