Is there a way to selectList without a filter or select options in Persistent Haskell?

Good day.

I have been studying Yesod for several weeks (I'm pretty new to Haskell) by writing a small project. I used MongoDB as a database and access it using persistent-mongoDB. When I want to run a query that does not have any conditions or sorting, for example

IN MONGODB SHELL
> db.comments.find();

I cannot find the correct way, at least in the Yesod Book .

I tried to write the same thing as a workaround.

IN YESOD REPL
*Application> db $ selectList [CommentContent !=. ""] []

But it sucks ...

The same problem in the transact-sql query. eg.

IN YESOD REPL
*Application> db $ count [CommentContent !=. "" ]
+4
source share
1 answer

Write what type do you want

myData :: [Entity YOUR_ENTITY_HERE] <- selectList [] []

( ScopedTypeVariables , , )

+6

Source: https://habr.com/ru/post/1608950/


All Articles