mongodb-erlang
mongodb-erlang copied to clipboard
how to do mathematical and Boolean operation?
How can i perform operation like $gt,$or,$and,$lt? I tried some combination but not working and I am not able to find any documentation also.
I tried like this
Selector = #{<<"vId">> => 22, <<"startTime">> => {"$gt", 2}}
mc_worker_api:find(Connection, Collection, Selector)
It is giving error,
exception exit: function_clause
in function bson_binary:put_field_accum/3
called as bson_binary:put_field_accum("$gt",2,<<>>)
Got it. Selector = #{<<"vId">> => 22, <<"startTime">> => {"$gte"=>2}}