carbon-io / carbond

MIT License
2 stars 5 forks source link

sort, skip, limit, projection are not working in MongoDBCollection #200

Open abdulito opened 7 years ago

abdulito commented 7 years ago

I get this error when i try to call find with projection option.

TypeError: cb is not a function
    at Collection.find (/Users/abdul/github/carbon-io/example__zipcode-service/node_modules/@carbon-io/leafnode/lib/collection.js:171:15)
    at C.find (/Users/abdul/github/carbon-io/example__zipcode-service/node_modules/@carbon-io/carbond/lib/mongodb/MongoDBCollection.js:121:54)

This happens because the options are not properly applied to the Cursor object return from the leafnode find

https://github.com/carbon-io/carbond/blob/b2edee3cc52c2cb82aa6fad535034a9f54cd9576/lib/mongodb/MongoDBCollection.js#L121-L121