Module

Dexie.Collection

Package
purescript-dexie
Repository
mushishi78/purescript-dexie

#and Source

and :: forall me. MonadEffect me => (Foreign -> Boolean) -> Collection -> me Collection

Same as filter.

Documentation: dexie.org/docs/Collection/Collection.and()

#clone Source

clone :: forall me. MonadEffect me => Collection -> me Collection

Manipulations on the returned Collection wont affect the original query.

Documentation: dexie.org/docs/Collection/Collection.clone()

#count Source

count :: Collection -> Promise Int

Number of items in the collection.

Documentation: dexie.org/docs/Collection/Collection.count()

#delete Source

delete :: Collection -> Promise Int

Deletes all objects in the query.

Documentation: dexie.org/docs/Collection/Collection.delete()

#distinct Source

distinct :: forall me. MonadEffect me => Collection -> me Collection

Removes any duplicates of primary keys in the collection. Useful only when working with multi valued indexes.

Documentation: dexie.org/docs/Collection/Collection.distinct()

#each Source

each :: (Foreign -> Effect Unit) -> Collection -> Promise Unit

Iterate over all objects in the collection.

Documentation: dexie.org/docs/Collection/Collection.each()

#eachKey Source

eachKey :: (Foreign -> Effect Unit) -> Collection -> Promise Unit

Iterate over the keys in the collection on the index used to create the collection.

Documentation: dexie.org/docs/Collection/Collection.eachKey()

#eachPrimaryKey Source

eachPrimaryKey :: (Foreign -> Effect Unit) -> Collection -> Promise Unit

Iterate over all primary keys of the objects in the collection.

Documentation: dexie.org/docs/Collection/Collection.eachPrimaryKey()

#eachUniqueKey Source

eachUniqueKey :: (Foreign -> Effect Unit) -> Collection -> Promise Unit

Iterate over the unique keys in the collection on the index used to create the collection.

Documentation: dexie.org/docs/Collection/Collection.eachUniqueKey()

#first Source

first :: Collection -> Promise Foreign

First item in the collection if any.

Documentation: dexie.org/docs/Collection/Collection.first()

#keys Source

keys :: Collection -> Promise (Array Foreign)

The keys in the collection on the index used to create the collection.

Documentation: dexie.org/docs/Collection/Collection.keys()

#last Source

last :: Collection -> Promise Foreign

Last item in the collection if any.

Documentation: dexie.org/docs/Collection/Collection.last()

#limit Source

limit :: forall me. MonadEffect me => Int -> Collection -> me Collection

Number of items to limit the results with.

Documentation: dexie.org/docs/Collection/Collection.limit()

#modify Source

modify :: forall me. MonadEffect me => Foreign -> Collection -> me Collection

Modifies all objects in the collection. Can use an object to set fields to a constant value. Can also use the modifyFn helper to map over the collection.

Documentation: dexie.org/docs/Collection/Collection.modify()

#offset Source

offset :: forall me. MonadEffect me => Int -> Collection -> me Collection

Skips the first N entries from the resulting Collection.

Documentation: dexie.org/docs/Collection/Collection.offset()

#primaryKeys Source

primaryKeys :: Collection -> Promise (Array Foreign)

Returns the primary keys for the objects in the collection.

Documentation: dexie.org/docs/Collection/Collection.primaryKeys()

#raw Source

raw :: forall me. MonadEffect me => Collection -> me Collection

Makes the resulting operation ignore any subscriber to onReading.

Documentation: dexie.org/docs/Collection/Collection.raw()

#reverse Source

reverse :: forall me. MonadEffect me => Collection -> me Collection

Reverse the sort order of the collection.

Documentation: dexie.org/docs/Collection/Collection.reverse()

#sortBy Source

sortBy :: String -> Collection -> Promise (Array Foreign)

Same as toArray but with manual sorting applied to the array. Similar to orderBy but does sorting on the resulting array rather than letting the backend implementation do the sorting.

Documentation: dexie.org/docs/Collection/Collection.sortBy()

#toArray Source

toArray :: Collection -> Promise (Array Foreign)

Returns array containing the found objects.

Documentation: dexie.org/docs/Collection/Collection.toArray()

#uniqueKeys Source

uniqueKeys :: Collection -> Promise (Array Foreign)

The unique keys in the collection on the index used to create the collection.

Documentation: dexie.org/docs/Collection/Collection.uniqueKeys()

#until Source

until :: forall me. MonadEffect me => (Foreign -> Boolean) -> Boolean -> Collection -> me Collection

Stop iterating the collection once given predicate returns true

Documentation: dexie.org/docs/Collection/Collection.until()

#modifyFn Source

modifyFn :: forall v me. MonadEffect me => (Foreign -> ModifyEffect v) -> Collection -> me Collection

Helper to use modify with a mapping function

Documentation: dexie.org/docs/Collection/Collection.modify()

#ModifyEffect Source

data ModifyEffect a

Return type for modifyFn to specify if you'd like to replace, ignore or delete the object

Constructors