ScottPJones / Mongo.jl

Mongo bindings for the Julia programming language
Other
43 stars 21 forks source link

'count' doesn't work with 'query' shortcut i.e. to do gt, lt, ne, eq queries #22

Open IanButterworth opened 7 years ago

IanButterworth commented 7 years ago

It would be helpful if the query shortcut worked for count as it does for find find

For instance, to find records that are not equal to a value:

for doc in find(collection, query("state" => ne("ma")))
...
end

The above works, but the following doesn't

numdocs = count(collection, query("state" => ne("ma")))

IanButterworth commented 7 years ago

While it's not exactly the same, it seems that this works

numdocs = count(collection, Dict("state" => ne("ma")))