Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

'not' find operator

  • Loading branch information...
commit 07ed0701eaa91fcc99810817907355e972ce5beb 1 parent b099a70
@SergejJurecko authored
Showing with 3 additions and 1 deletion.
  1. +1 −1  mongoapi.erl
  2. +2 −0  mongodb.erl
View
2  mongoapi.erl
@@ -139,7 +139,7 @@ batchInsert(LRecs) ->
% Documents with i between 2 and 5: Mong:find(#mydoc{i = {in, {gt, 2}, {lt, 5}}}, undefined, 0,0).
% in example: Mong:find(#mydoc{tags = {in, [2,3,4]}}, undefined, 0,0).
% exists example: Mong:find(#mydoc{tags = {exists, false}}, undefined, 0,0).
-% Advanced query options: gt,lt,gte,lte, ne, in, nin, all, size, exists
+% Advanced query options: gt,lt,gte,lte, ne, in, nin, all, size, exists,'not'
% Possible regex options: "ilmsux" -> IN THIS SEQUENCE! (not all are necessary of course)
% i case-insensitive matching
% m multiline: "^" and "$" match the beginning / end of each line as well as the whole string
View
2  mongodb.erl
@@ -1135,6 +1135,8 @@ encode_element({Name, {all, Val}}) ->
encode_element({Name, [{<<"$all">>, {array, Val}}]});
encode_element({Name, {size, Val}}) ->
encode_element({Name, [{<<"$size">>, Val}]});
+encode_element({Name, {'not', Val}}) ->
+ encode_element({Name, [{<<"$not">>, Val}]});
encode_element({Name, {exists, Val}}) ->
encode_element({Name, [{<<"$exists">>, Val}]});
encode_element({Name, {binary, SubType, Data}}) ->
Please sign in to comment.
Something went wrong with that request. Please try again.