Permalink
Browse files

Merge pull request #18 from goya/master

Added $near operator
  • Loading branch information...
2 parents d8e5d0a + 5684ea3 commit ded0c8cb7c463c032fd8d89c15ba2172d1aceb07 @jkvor committed Jun 25, 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 ded0c8c

Please sign in to comment.