You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

Queries

Queries

Search results for "Queries"

Dynamic Content / Repeater

To transform this remaining row into a repeater element, click the <tr> element and “Repeater” in the main tab to configure the repeater options. You can choose one of the following options to retrieve a collection of results from a data source: “Flows”, “REST Queries” and “Function Queries”. In this tutorial, we use a simple function query, so click the “Function Query” button and enter the following expression into the textarea:

More Search Options

If you need more search options, e.g. search on multiple types, facetted search etc., have a look at the the following options:

  • create a common base type and use the collection resource of that type to search for objects of different types
  • create a search page with an embedded script to run custom queries, process the results and return a JSON result
  • use the Cypher endpoint to use graph queries

Soft result count limit

database.result.softlimit Applies a soft limit on the result size of queries. If queries exceed the specified number of results, it will not display the exact result count, but the soft limit instead.

REST Query

The REST repeater configuration allows entering a REST URI and supports all query features a regular REST query supports. This includes sort, order, page, pageSize, range queries etc.

It is not necessary to include the REST base path /structr/rest/.
Further, it is not necessary to create resource access grants for these REST queries as they are run internally.

Debugging

log.cypher.debug Prints all generated cypher queries to the server log. if enabled.
log.cypher.debug.ping If enabled, queries generated for the Websocket PING request will be logged. Can only be used in conjunction with log.cypher.debug.

TypeQuery

Name Description
Type Allows to select a type to query
DataSource Accepts connections from DataTarget outputs and makes a data object available in scripting contexts opened within attribute queries.

Built-in Functions

Built-in functions provide access to the Structr Backend API from within a scripting context. You can run database queries, process the results, create or modify objects, and much more.

Widgets

When dragging a Widget into a page, a new set of DOM elements is created as child nodes of the node the Widget was dropped onto, including metadata defined in the Widget source like data binding and queries. The textual information contained in the Widget is transformed into database elements (nodes, relationships and properties) as well.

Using Cypher to create data

You can use your own Cypher queries to create data in the underlying database as long as you make sure that the type attribute always contains the name of the target type in the Structr data model.

Advanced Search Capabilities

Besides simple value-based filters, Structr also supports other search methods:

  • inexact search
  • geographical distance search
  • range queries
  • empty / non-empty values

Result Streaming

database.result.lazy Forces Structr to use lazy evaluation for relationship queries.