Hoogle Search

Within LTS Haskell 24.32 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. (=~.) :: forall record searchable . (MongoRegexSearchable searchable, PersistEntity record, PersistEntityBackend record ~ MongoContext) => EntityField record searchable -> MongoRegex -> Filter record

    persistent-mongoDB Database.Persist.MongoDB

    Filter using a Regular expression.

  2. (?&->.) :: forall record typ nest . PersistEntity nest => EntityField record (Maybe nest) -> EntityField nest typ -> NestedField record typ

    persistent-mongoDB Database.Persist.MongoDB

    Same as &->., but Works against a Maybe type

  3. (?&~>.) :: forall val nes nes1 . PersistEntity nes1 => EntityField val (Maybe nes1) -> NestedField nes1 nes -> NestedField val nes

    persistent-mongoDB Database.Persist.MongoDB

    Same as &~>., but works against a Maybe type

  4. (~>.) :: forall record typ emb . PersistEntity emb => EntityField record [emb] -> NestedField emb typ -> NestedField record typ

    persistent-mongoDB Database.Persist.MongoDB

    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.

  5. (!=.) :: forall v typ . PersistField typ => EntityField v typ -> typ -> Filter v

    persistent-mtl Database.Persist.Sql.Shim

    Non-equality check.

    Examples

    selectSimon :: MonadIO m => ReaderT SqlBackend m [Entity User]
    selectSimon = selectList [UserName !=. "SPJ" ] []
    
    The above query when applied on dataset-1, will produce this:
    +-----+-----+-----+
    |id   |name |age  |
    +-----+-----+-----+
    |2    |Simon|41   |
    +-----+-----+-----+
    

  6. (*=.) :: forall v typ . PersistField typ => EntityField v typ -> typ -> Update v

    persistent-mtl Database.Persist.Sql.Shim

    Assign a field by multiplication (*=).

    Examples

    multiplyAge :: MonadIO m => ReaderT SqlBackend m ()
    multiplyAge = updateWhere [UserName ==. "SPJ" ] [UserAge *=. 2]
    
    The above query when applied on dataset-1, will produce this:
    +-----+-----+--------+
    |id   |name |age     |
    +-----+-----+--------+
    |1    |SPJ  |40 -> 80|
    +-----+-----+--------+
    |2    |Simon|41      |
    +-----+-----+--------+
    

  7. (+=.) :: forall v typ . PersistField typ => EntityField v typ -> typ -> Update v

    persistent-mtl Database.Persist.Sql.Shim

    Assign a field by addition (+=).

    Examples

    addAge :: MonadIO m => ReaderT SqlBackend m ()
    addAge = updateWhere [UserName ==. "SPJ" ] [UserAge +=. 1]
    
    The above query when applied on dataset-1, will produce this:
    +-----+-----+---------+
    |id   |name |age      |
    +-----+-----+---------+
    |1    |SPJ  |40 -> 41 |
    +-----+-----+---------+
    |2    |Simon|41       |
    +-----+-----+---------+
    

  8. (-=.) :: forall v typ . PersistField typ => EntityField v typ -> typ -> Update v

    persistent-mtl Database.Persist.Sql.Shim

    Assign a field by subtraction (-=).

    Examples

    subtractAge :: MonadIO m => ReaderT SqlBackend m ()
    subtractAge = updateWhere [UserName ==. "SPJ" ] [UserAge -=. 1]
    
    The above query when applied on dataset-1, will produce this:
    +-----+-----+---------+
    |id   |name |age      |
    +-----+-----+---------+
    |1    |SPJ  |40 -> 39 |
    +-----+-----+---------+
    |2    |Simon|41       |
    +-----+-----+---------+
    

  9. (/<-.) :: forall v typ . PersistField typ => EntityField v typ -> [typ] -> Filter v

    persistent-mtl Database.Persist.Sql.Shim

    Check if value is not in given list.

    Examples

    selectSimon :: MonadIO m => ReaderT SqlBackend m [Entity User]
    selectSimon = selectList [UserAge /<-. [40]] []
    
    The above query when applied on dataset-1, will produce this:
    +-----+-----+-----+
    |id   |name |age  |
    +-----+-----+-----+
    |2    |Simon|41   |
    +-----+-----+-----+
    

  10. (/=.) :: forall v typ . PersistField typ => EntityField v typ -> typ -> Update v

    persistent-mtl Database.Persist.Sql.Shim

    Assign a field by division (/=).

    Examples

    divideAge :: MonadIO m => ReaderT SqlBackend m ()
    divideAge = updateWhere [UserName ==. "SPJ" ] [UserAge /=. 2]
    
    The above query when applied on dataset-1, will produce this:
    +-----+-----+---------+
    |id   |name |age      |
    +-----+-----+---------+
    |1    |SPJ  |40 -> 20 |
    +-----+-----+---------+
    |2    |Simon|41       |
    +-----+-----+---------+
    

Page 149 of many | Previous | Next