-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Backend for the persistent library using mongoDB. -- -- MongoDB backend for the persistent library. @package persistent-mongoDB @version 1.3.2 -- | Use persistent-mongodb the same way you would use other persistent -- libraries and refer to the general persistent documentation. There are -- some new MongoDB specific filters under the filters section. These -- help extend your query into a nested document. -- -- However, at some point you will find the normal Persistent APIs -- lacking. and want lower level-level MongoDB access. There are -- functions available to make working with the raw driver easier: they -- are under the Entity conversion section. You should still use the same -- connection pool that you are using for Persistent. -- -- MongoDB is a schema-less database. The MongoDB Persistent backend does -- not help perform migrations. Unlike SQL backends, uniqueness -- constraints cannot be created for you. You must place a unique index -- on unique fields. module Database.Persist.MongoDB collectionName :: PersistEntity record => record -> Text -- | convert a PersistEntity into document fields. unlike -- toInsertFields, nulls are included. entityToDocument :: PersistEntity record => record -> [Field] -- | Deprecated, use the better named entityToDocument -- | Deprecated: Please use entityToDocument instead entityToFields :: PersistEntity record => record -> [Field] -- | convert a PersistEntity into document fields. for inserts only: nulls -- are ignored so they will be unset in the document. -- entityToFields includes nulls toInsertFields :: PersistEntity record => record -> [Field] docToEntityEither :: PersistEntity record => Document -> Either Text (Entity record) docToEntityThrow :: (MonadIO m, PersistEntity record) => Document -> m (Entity record) -- | The normal Persistent equality test (==.) is not generic enough. -- Instead use this with the drill-down operaters (->.) or (?->.) nestEq :: (PersistField typ, PersistEntityBackend record ~ MongoBackend) => NestedField record typ -> typ -> Filter record -- | use to see if an embedded list contains an item multiEq :: (PersistField typ, PersistEntityBackend record ~ MongoBackend) => EntityField record [typ] -> typ -> Filter record -- | same as nestEq, but give a BSON Value nestBsonEq :: (PersistField typ, PersistEntityBackend record ~ MongoBackend) => NestedField record typ -> Value -> Filter record -- | same as multiEq, but give a BSON Value multiBsonEq :: (PersistField typ, PersistEntityBackend record ~ MongoBackend) => EntityField record [typ] -> Value -> Filter record -- | Filter using a Regular expression. (=~.) :: (PersistEntity record, PersistEntityBackend record ~ MongoBackend) => EntityField record Text -> MongoRegex -> Filter record -- | Filter using a Regular expression against a nullable field. (?=~.) :: (PersistEntity record, PersistEntityBackend record ~ MongoBackend) => EntityField record (Maybe Text) -> MongoRegex -> Filter record -- | A MongoRegex represetns a Regular expression. It is a tuple of the -- expression and the options for the regular expression, respectively -- Options are listed here: -- http://docs.mongodb.org/manual/reference/operator/query/regex/ -- If you use the same options you may want to define a helper such as -- r t = (t, ims) type MongoRegex = (Text, Text) -- | Point to an array field with an embedded object and give a deeper -- query into the embedded object. Use with nestEq. (->.) :: PersistEntity emb => EntityField record [emb] -> EntityField emb typ -> NestedField record typ -- | Point to an array field with an embedded object and give a deeper -- query into the embedded object. This level of nesting is not the final -- level. Use ->. or &->. to point to the final -- level. (~>.) :: PersistEntity emb => EntityField record [emb] -> NestedField emb typ -> NestedField record typ -- | Same as &->., but Works against a Maybe type (?&->.) :: PersistEntity nest => EntityField record (Maybe nest) -> EntityField nest typ -> NestedField record typ -- | Same as &~>., but works against a Maybe type (?&~>.) :: PersistEntity nes1 => EntityField val (Maybe nes1) -> NestedField nes1 nes -> NestedField val nes -- | Point to a nested field to query. This field is not an array type. Use -- with nestEq. (&->.) :: PersistEntity nest => EntityField record nest -> EntityField nest typ -> NestedField record typ -- | Point to a nested field to query. This field is not an array type. -- This level of nesting is not the final level. Use ->. or -- &>. to point to the final level. (&~>.) :: PersistEntity nes1 => EntityField val nes1 -> NestedField nes1 nes -> NestedField val nes data NestedField record typ LastEmbFld :: EntityField record [emb] -> EntityField emb typ -> NestedField record typ MidEmbFld :: EntityField record [emb] -> NestedField emb typ -> NestedField record typ MidNestFlds :: EntityField record nest -> NestedField nest typ -> NestedField record typ MidNestFldsNullable :: EntityField record (Maybe nest) -> NestedField nest typ -> NestedField record typ LastNestFld :: EntityField record nest -> EntityField nest typ -> NestedField record typ LastNestFldNullable :: EntityField record (Maybe nest) -> EntityField nest typ -> NestedField record typ -- | wrapper of ObjectId -- --