ScottPJones / Mongo.jl

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

Limit Results #1

Closed Rockyyost closed 9 years ago

Rockyyost commented 9 years ago

How do you limit results in a query?

I've tired the following, to limit to 10 docs:

for doc in find(collection, query, 0, 10) println(doc) end

But I get this error: 'find' has no method matching find(::MongoCollection, ::Dict{Any, Any}, ::Int64, ::Int64)

Thank you for your help!

ghost commented 9 years ago

Hi there, I just checked the source and it looks like you want to do find(collection, query, skip=0, limit=10). Let me know if that works!