search( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a search operation to find items in a database collection.

The search() method builds a search operation to find data items in the specified collection based on text search and filter criteria. It returns a WixDataSearch object that defines the search operation, which you can refine by chaining WixDataSearch methods onto it. These methods define the search expression and mode, apply filters, and control sorting and pagination of search results.

The methods chained to search() are applied in the order they are called. For example, if you specify an expression, apply filters, and then sort by a field, the search first finds items that match the expression and filters, and then sorts the results.

Finally, to run the search, chain run() as the last method.

The search() method runs with the following WixDataSearch defaults that you can override:

  • skip: 0
  • limit: 100
  • ascending: by _id

Notes:

Permissions
Read Data Items
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
dataCollectionIdstringRequired

ID of the collection in which to run the search.

Returns
Return Type:WixDataSearch
Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?