selectel / mongoDB-haskell

MongoDB driver for Haskell
http://hackage.haskell.org/package/mongoDB
Apache License 2.0
21 stars 11 forks source link

eval only expects a javascript object from server #1

Closed YoEight closed 12 years ago

YoEight commented 12 years ago

Hi,

eval function in Database.MongoDB.Query module only expects a javascript object from server.

this will failed


eval (Javascript ([] :: [Field]) "return 5;")

You've to trick it like this


eval (Javascript ([] :: [Field]) "return {foo: 5};")
knsd commented 12 years ago

Thanks for the issue! I will change eval function's signature to eval :: (MonadIO m, Val v) => Javascript -> Action m v in next release.