emongo / src / emongo.erl

Diff from to

src/emongo.erl

     QueryRec#emo_query{q=QueryDoc};
 
 create_query([], QueryRec, [], OptDoc) ->
-    QueryRec#emo_query{q=OptDoc};
+    QueryRec#emo_query{q=(OptDoc ++ [{<<"$query">>, [{none, none}]}])};
 
 create_query([], QueryRec, QueryDoc, OptDoc) ->
-    QueryRec#emo_query{q=(OptDoc ++ [{<<"query">>, QueryDoc}])};
+    QueryRec#emo_query{q=(OptDoc ++ [{<<"$query">>, QueryDoc}])};
 
 create_query([{limit, Limit}|Options], QueryRec, QueryDoc, OptDoc) ->
     QueryRec1 = QueryRec#emo_query{limit=Limit},
 
 create_query([{orderby, Orderby}|Options], QueryRec, QueryDoc, OptDoc) ->
     Orderby1 = [{Key, case Dir of desc -> -1; _ -> 1 end}|| {Key, Dir} <- Orderby],
-    OptDoc1 = [{<<"orderby">>, Orderby1}|OptDoc],
+    OptDoc1 = [{<<"$orderby">>, Orderby1}|OptDoc],
     create_query(Options, QueryRec, QueryDoc, OptDoc1);
 
 create_query([{fields, Fields}|Options], QueryRec, QueryDoc, OptDoc) ->
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.