Safe Haskell | None |
---|---|
Language | Haskell2010 |
- mongoKeyToByteString :: ToBackendKey MongoContext record => Key record -> ByteString
- byteStringToMongoKey :: ToBackendKey MongoContext record => ByteString -> Maybe (Key record)
Documentation
mongoKeyToByteString :: ToBackendKey MongoContext record => Key record -> ByteString Source #
Used for creating instances of ToAudit when the original model database is Mongo and the audit model database is SQL. ==== Example User ident Text password Text Maybe UniqueUser ident UserAudit ident Text password Text Maybe originalId ByteString auditAction AuditAction editedBy Text editedOn UTCTime instance ToAudit User where type AuditResult User = UserAudit toAudit v k auditAction editedBy editedOn = UserAudit (userIdent v) (userPassword v) (mongoKeyToByteString k) auditAction editedBy editedOn
byteStringToMongoKey :: ToBackendKey MongoContext record => ByteString -> Maybe (Key record) Source #
Used for when Mongo stored in SQL needs to be converted to a Key to query the original MongoDB.