Peristent with MongoDB in Servant
<p>I try to use <code>persistent</code> with MongoDB in Servant webservices APIs.
Below is my model code (<code>Model.hs</code>)</p>

<pre><code>let mongoSettings = (mkPersistSettings (ConT ''MongoContext))
    in share [mkPersist mongoSettings, mkMigrate "migrateAll"] [persistLowerCase|
User
    fam   String
    im    String 
    ot    String 
    email String 
    login String
    pswd  String
    deriving Show
|]

$(deriveJSON defaultOptions ''User)
</code></pre>

<p>And the code to access the database:</p>

<pre><code>usersGet :: AppM [User]
usersGet = do 
    resultDB &lt;- runDb $ do rest =&lt;&lt; find (select [] "user")
    return resultDB
</code></pre>

<p>Which gives me an error:</p>

<pre><code>Error: Expected type: [User] Actual type: [Document].
</code></pre>

<p>I understand the error, but I thought that the library should automatically generate the necessary functions for the conversion from <code>Document -&gt; User</code>.</p>

<p>What is function that generates for that?</p>