Skip to main content

Search

The search parameter allows you to perform a keyword search across one or more columns in your table.

Search Parameters

ParameterTypeRequiredDescription
columnsstring[]YesThe specific fields to search within.
querystringYesThe keyword or phrase to search for.

This example searches for "Alice" in the first_name and email columns.

TypeScript
const users = await manta.fetchAllRecords({
table: "users",
fields: ["user_id", "first_name", "last_name", "email"],
search: {
columns: ["first_name", "email"],
query: "Alice",
},
page: 1,
list: 10,
});

Combined search and filter

You can combine a keyword search with a where filter to refine your results even further. This example shows how to search for users where either the first_name or email contains the term 'Alice' when the status field is active.

TypeScript
const users = await manta.fetchAllRecords({
table: "users",
fields: ["user_id", "first_name", "last_name", "email"],
where: {
status: "active",
},
search: {
columns: ["first_name", "email"],
query: "Alice",
},
page: 1,
list: 5,
})