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.

search()

Usage

search(type, key, value, key, value, ...)
search(type, key, value)
search(type, map)
search(type)

Description
The search() method is very similar to find(), except that it is case-insensitive / inexact. It returns a collection of entities, which can be empty if none of the existing nodes or relationships matches the given search parameters.

search() accepts several different parameter combinations, whereas the first parameter is always the name of the type to retrieve from the database. The second parameter can either be a map (e.g. a result from nested function calls) or a list of (key, value) pairs. Calling search() with only a single parameter will return all the nodes of the given type (which might be dangerous if there are many of them in the database).

Examples
For this example, we assume that there are three users in the database: [admin, tester1, tester2].

${search('User')}
${search('User', 'name', 'test')}

results in

[7379af469cd645aebe1a3f8d52b105bd, a05c044697d648aefe3ae4589af305bd, 505d0d469cd645aebe1a3f8d52b105bd]
[a05c044697d648aefe3ae4589af305bd, 505d0d469cd645aebe1a3f8d52b105bd]

Search results for "search()"

search()

The search() method is very similar to find(), except that it is case-insensitive / inexact. It returns a collection of entities, which can be empty if none of the existing nodes or relationships matches the given search parameters.
search() accepts several different parameter combinations, whereas the first parameter is always the name of the type to retrieve from the database. The second parameter can either be a map (e.g. a result from nested function calls) or a list of (key, value) pairs. Calling search() with only a single parameter will return all the nodes of the given type (which might be dangerous if there are many of them in the database).

search(type [, key1, value1 [, ... ]] )
search(type [, map ])
search(type [, uuid ])
search(type)