Commits

Anonymous committed a31b5b9

explain option

Comments (0)

Files changed (1)

 %%   Collection = string()
 %%   Selector = document()
 %%   Options = [Option]
-%%   Option = {timeout, Timeout} | {limit, Limit} | {offset, Offset} | {orderby, Orderby} | {fields, Fields} | response_options
+%%   Option = {timeout, Timeout} | {limit, Limit} | {offset, Offset} | {orderby, Orderby} | {fields, Fields} | explain
 %%   Timeout = integer (timeout in milliseconds)
 %%   Limit = integer
 %%   Offset = integer
     QueryRec1 = QueryRec#emo_query{field_selector=[{Field, 1} || Field <- Fields]},
     create_query(Options, QueryRec1, QueryDoc, OptDoc);
 
+create_query([explain | Options], QueryRec, QueryDoc, OptDoc) ->
+    create_query(Options, QueryRec, QueryDoc, [{<<"$explain">>,true}|OptDoc]);
+
 create_query([_|Options], QueryRec, QueryDoc, OptDoc) ->
     create_query(Options, QueryRec, QueryDoc, OptDoc).