mongodb-erlang icon indicating copy to clipboard operation
mongodb-erlang copied to clipboard

how to do mathematical and Boolean operation?

Open HiteshVaghani opened this issue 6 years ago • 1 comments

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,<<>>)

HiteshVaghani avatar Jul 19 '18 11:07 HiteshVaghani

Got it. Selector = #{<<"vId">> => 22, <<"startTime">> => {"$gte"=>2}}

HiteshVaghani avatar Jul 19 '18 13:07 HiteshVaghani