Good day.
I'm learning Yesod a few weeks (I am pretty new to Haskell) by writing a little project.I used MongoDB as the DB and accessing it by persistent-mongoDB. When I want to run a query which have no any conditions or sorting stuff, e.g.
IN MONGODB SHELL
> db.comments.find();
I can not find a correct way at least in the Yesod Book.
I tried to write a identical as a workaround.
IN YESOD REPL
*Application> db $ selectList [CommentContent !=. ""] []
But it sucks...
The same issue in a transact-sql query. e.g.
IN YESOD REPL
*Application> db $ count [CommentContent !=. "" ]
Write what type you want
myData :: [Entity YOUR_ENTITY_HERE] <- selectList [] []
(I used ScopedTypeVariables
here but is not needed if type can be inferred in other way)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With