dberta.keyrangefuncs - cieszynski/dberta.js GitHub Wiki

This static functions are helper to build keyranges wherever you need.

value could include anything that can be expressed in JavaScript, including boolean, number, string, date, object, array, regexp, undefined, and null.

Example

    tx.user.where(
        'username', 
        dberta.eq('bob')
    ).then(result=>{[...]})


    tx.user.where(
        'age', 
        dberta.between(18, 65)
    ).then(result=>{[...]})

eq

Find equal to the expression.

Syntax

eq(z)

Parameter

z value

Return

IDBKeyRange

le

Find lower than or equal to the expression.

Syntax

le(x)

Parameter

x value

Return

IDBKeyRange

lt

Find lower than to the expression.

Syntax

lt(x)

Parameter

x value

Return

IDBKeyRange

ge

Find greater than or equal to the expression.

Syntax

ge(y)

Parameter

y value

Return

IDBKeyRange

gt

Find greater than to the expression.

Syntax

gt(y)

Parameter

y value

Return

IDBKeyRange

between

Find in range with the specified upper and lower bounds.

Syntax

between(x, y[, bx[, by]])

Parameter

x, y value

bx, by boolean, the bounds include (true, default) or exclude (false) the endpoint values.

Return

IDBKeyRange

startsWith

Finds everything that begins with the string (case sensitive)

Syntax

startsWith(s)

s string

Return

IDBKeyRange