Skip to content

@lancedb/lancedb • Docs


@lancedb/lancedb / Expr

Class: Expr

A SQL expression backed by the shared LanceDB expression builder.

Example

table.query().where(col("firstName").eq("Alice")).toArray();

Constructors

new Expr()

new Expr(inner): Expr

Parameters

  • inner: Expr

Returns

Expr

Properties

inner

inner: Expr;

Methods

add()

add(other): Expr

Add a value.

Parameters

Returns

Expr


and()

and(other): Expr

Combine two predicates with AND.

Parameters

Returns

Expr


cast()

cast(dataType): Expr

Cast to an Arrow data type, such as "Int64".

Parameters

  • dataType: string

Returns

Expr


contains()

contains(substr): Expr

Test whether a string contains a substring.

Parameters

Returns

Expr


div()

div(other): Expr

Divide by a value.

Parameters

Returns

Expr


eq()

eq(other): Expr

Compare for equality.

Parameters

Returns

Expr


gt()

gt(other): Expr

Compare for greater than.

Parameters

Returns

Expr


gte()

gte(other): Expr

Compare for greater than or equal to.

Parameters

Returns

Expr


isIn()

isIn(values): Expr

Test membership in a list of values.

Parameters

Returns

Expr


lower()

lower(): Expr

Convert a string to lowercase.

Returns

Expr


lt()

lt(other): Expr

Compare for less than.

Parameters

Returns

Expr


lte()

lte(other): Expr

Compare for less than or equal to.

Parameters

Returns

Expr


mul()

mul(other): Expr

Multiply by a value.

Parameters

Returns

Expr


ne()

ne(other): Expr

Compare for inequality.

Parameters

Returns

Expr


not()

not(): Expr

Negate this predicate.

Returns

Expr


or()

or(other): Expr

Combine two predicates with OR.

Parameters

Returns

Expr


sub()

sub(other): Expr

Subtract a value.

Parameters

Returns

Expr


toSql()

toSql(): string

Serialize with the LanceDB SQL dialect, preserving column case.

Returns

string


upper()

upper(): Expr

Convert a string to uppercase.

Returns

Expr