SecondaryIndex

org.scanamo.SecondaryIndex
sealed abstract class SecondaryIndex[V]

Represents a secondary index on a DynamoDB table.

Can be constructed via the index method on Table

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def filter[C : ConditionExpression](condition: C): SecondaryIndex[V]

Filter the results of scan or query within DynamoDB

Filter the results of scan or query within DynamoDB

Note that rows filtered out still count towards your consumed capacity

Attributes

def from(exclusiveStartKey: DynamoObject): SecondaryIndex[V]

Primes a search request with a key to start from:

Primes a search request with a key to start from:

Value parameters

exclusiveStartKey

A DynamoObject containing attributes that match the partition key and sort key of the secondary index as well as the partition key of the table itself

Attributes

Returns

A new SecondaryIndex which when queried will return items after the provided exclusive start key

Example
 import org.scanamo._
 import org.scanamo.syntax._
 val table: Table[_] = ???
 val secondaryIndex: SecondaryIndex[_] = table.index("myIndex")
 val exclusiveStartKey = DynamoObject(
   Map(
     "myIndexPartitionKeyName" -> myIndexPartitionKeyValue.asDynamoValue,
     "myIndexSortKeyName" -> myIndexSortKeyValue.asDynamoValue,
     "myTablePartitionKeyName" -> myTablePartitionKeyValue.asDynamoValue
   )
 )
 val indexStartingFromExclusiveStartKey: SecondaryIndex[_] = secondaryIndex.from(exclusiveStartKey)
def limit(n: Int): SecondaryIndex[V]

Query or scan an index, limiting the number of items evaluated by Dynamo

Query or scan an index, limiting the number of items evaluated by Dynamo

Attributes

Run a query against keys in a secondary index

Run a query against keys in a secondary index

Attributes

def queryPaginatedM[M[_] : MonoidK](query: Query[_], pageSize: Int): ScanamoOpsT[M, List[Either[DynamoReadError, V]]]

Performs a scan with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page, with a maximum of pageSize items per page.

Performs a scan with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page, with a maximum of pageSize items per page.

Attributes

Note

DynamoDB will only ever return maximum 1MB of data per query, so pageSize is an upper bound.

def queryRaw(query: Query[_]): ScanamoOps[QueryResponse]

Queries the index and returns the raw DynamoDB result.

Queries the index and returns the raw DynamoDB result.

Attributes

Scan a secondary index

Scan a secondary index

Attributes

def scanPaginatedM[M[_] : MonoidK](pageSize: Int): ScanamoOpsT[M, List[Either[DynamoReadError, V]]]

Performs a scan with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page, with a maximum of pageSize items per page..

Performs a scan with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page, with a maximum of pageSize items per page..

Attributes

Note

DynamoDB will only ever return maximum 1MB of data per scan, so pageSize is an upper bound.

def scanRaw: ScanamoOps[ScanResponse]

Scans the index and returns the raw DynamoDB result.

Scans the index and returns the raw DynamoDB result.

Attributes

Concrete methods

final def queryM[M[_] : MonoidK](query: Query[_]): ScanamoOpsT[M, List[Either[DynamoReadError, V]]]

Performs a query with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page.

Performs a query with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page.

To control how many maximum items to load at once, use queryPaginatedM

Attributes

final def scanM[M[_] : MonoidK]: ScanamoOpsT[M, List[Either[DynamoReadError, V]]]

Performs a scan with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page.

Performs a scan with the ability to introduce effects into the computation. This is useful for huge tables when you don't want to load the whole of it in memory, but scan it page by page.

To control how many maximum items to load at once, use scanPaginatedM

Attributes