Module Documentation
May 6, 2015 ยท View on GitHub
Module Database.Mongo.Mongo
DB
data DB :: !
The effect type for DB request made with Mongo
Client
data Client :: *
Database
data Database :: *
Collection
data Collection :: *
Cursor
data Cursor :: *
AffDatabase
type AffDatabase e = Aff (db :: DB | e) Database
AffCollection
type AffCollection e = Aff (db :: DB | e) Collection
AffCursor
type AffCursor e = Aff (db :: DB | e) Cursor
AffResult
type AffResult e a = Aff (db :: DB | e) a
AffUnit
type AffUnit e = Aff (db :: DB | e) Unit
AffWriteResult
type AffWriteResult e = Aff (db :: DB | e) WriteResult
Selector
type Selector = Document
Fields
type Fields = Document
showMethodType
instance showMethodType :: Show FnType
connect
connect :: forall e. ConnectionInfo -> AffDatabase e
Makes a connection to the database.
close
close :: forall e. Database -> AffUnit e
Close the connection to the database
collection
collection :: forall e. String -> Database -> AffCollection e
Get the collection
findOne
findOne :: forall e a. (DecodeJson a) => Document -> Document -> Collection -> AffResult e a
Find one item in the collection
find
find :: forall e. Document -> Document -> Collection -> AffCursor e
Find in the collection (essentially findMany)
collect
collect :: forall e a. (DecodeJson a) => Cursor -> AffResult e a
Collect the results from the cursor
collectOne
collectOne :: forall e a. (DecodeJson a) => Cursor -> AffResult e a
Collect one result from the cursor
insertOne
insertOne :: forall e a. (EncodeJson a) => a -> InsertOptions -> Collection -> AffWriteResult e
Insert a new document using the selector, returning the write result
insertMany
insertMany :: forall e a. (EncodeJson a) => a -> InsertOptions -> Collection -> AffWriteResult e
Insert new documents using the selector, returning the write result
updateOne
updateOne :: forall e. Document -> Fields -> UpdateOptions -> Collection -> AffWriteResult e
Update a new document using the selector, returning the write result
updateMany
updateMany :: forall e. Document -> Fields -> UpdateOptions -> Collection -> AffWriteResult e
Update documents using the selector, returning the write result
connect'
connect' :: forall e. ConnectionInfo -> (Error -> Eff (db :: DB | e) Unit) -> (Database -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
Run a request directly without using 'Aff'
close'
close' :: forall e. Database -> (Error -> Eff (db :: DB | e) Unit) -> (Unit -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
collection'
collection' :: forall e. String -> Database -> (Error -> Eff (db :: DB | e) Unit) -> (Collection -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
findOne'
findOne' :: forall e a. (DecodeJson a) => Selector -> Fields -> Collection -> (Error -> Eff (db :: DB | e) Unit) -> (a -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
find'
find' :: forall e. Selector -> Fields -> Collection -> (Error -> Eff (db :: DB | e) Unit) -> (Cursor -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
collect'
collect' :: forall e a. (DecodeJson a) => Cursor -> (Error -> Eff (db :: DB | e) Unit) -> (a -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
collectOne'
collectOne' :: forall e a. (DecodeJson a) => Cursor -> (Error -> Eff (db :: DB | e) Unit) -> (a -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
insertOne'
insertOne' :: forall e a. (EncodeJson a) => a -> InsertOptions -> Collection -> (Error -> Eff (db :: DB | e) Unit) -> (WriteResult -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
insertMany'
insertMany' :: forall e a. (EncodeJson a) => a -> InsertOptions -> Collection -> (Error -> Eff (db :: DB | e) Unit) -> (WriteResult -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
updateOne'
updateOne' :: forall e. Selector -> Fields -> UpdateOptions -> Collection -> (Error -> Eff (db :: DB | e) Unit) -> (WriteResult -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))
updateMany'
updateMany' :: forall e. Selector -> Fields -> UpdateOptions -> Collection -> (Error -> Eff (db :: DB | e) Unit) -> (WriteResult -> Eff (db :: DB | e) Unit) -> Eff (db :: DB | e) (Canceler (db :: DB | e))