emongo icon indicating copy to clipboard operation
emongo copied to clipboard

array of integers

Open benbro opened this issue 15 years ago • 0 comments

emonogo turns a list of integers to a binary string. Probably because a string is a list in erlang. Maybe emongo should except strings only as binaries and list of integer will be a list of integers?

In the shell db.user.insert({k1: "v1", "k2": [1,2]}) db.user.find() { "_id" : ObjectId("4b7e885bf1e7e6a4f6ac5193"), "k1" : "v1", "k2" : [ 1, 2 ] }

With emongo: emongo:insert(<<"mydb">>, "user", [{"k1", "v1"}, {"k2", [1, 2]}]). emongo:find(<<"mydb">>, "user"). [[{<<"_id">>, {oid,<<75,126,137,24,228,24,138,65,245,88,191,247>>}}, {<<"k1">>,<<"v1">>}, {<<"k2">>,<<1,2>>}]]

benbro avatar Feb 19 '10 12:02 benbro