diff --git a/pages/memgraph-lab/configuration.mdx b/pages/memgraph-lab/configuration.mdx index ae72cb42f..9aa2b65e6 100644 --- a/pages/memgraph-lab/configuration.mdx +++ b/pages/memgraph-lab/configuration.mdx @@ -159,6 +159,7 @@ valid Memgraph Enterprise license are available only in a Docker environment. | `STORAGE_MG_USERNAME` | `(Enterprise only)` Memgraph username for the Lab remote storage | `string` | | | `STORAGE_MG_PASSWORD` | `(Enterprise only)` Memgraph password for the Lab remote storage | `string` | | | `STORAGE_MG_CONNECT_TIMEOUT_MS` | `(Enterprise only)` Connection timeout in milliseconds for remote storage | `integer` | `10000` | +| `STORAGE_MG_CONNECT_RETRY_MAX_COUNT` | `(Enterprise only)` The maximum number of retries allowed for a successful connection during Lab startup | `integer` | `5` | | `STREAM_NAME_MAX_LEN` | Max length of the stream name | `integer` | `500` | | `STREAM_VALIDATION_IS_ENABLED` | State of stream validation | `boolean` | `false` | diff --git a/pages/memgraph-lab/features/sharing-features.mdx b/pages/memgraph-lab/features/sharing-features.mdx index 3d2ed4f0f..7327da8cb 100644 --- a/pages/memgraph-lab/features/sharing-features.mdx +++ b/pages/memgraph-lab/features/sharing-features.mdx @@ -17,7 +17,7 @@ Here are the currently available sharing features: - [Graph Style Script (GSS) sharing](#graph-style-script-sharing) – Share custom graph styling scripts among team members to maintain a consistent - visualization style. + visualization style. - [Query sharing](#query-sharing) – Create a shareable link for their Cypher query, Graph Style Script, and query parameters with a single click. @@ -25,7 +25,7 @@ query, Graph Style Script, and query parameters with a single click. **Enterprise**: Sharing features require a Memgraph Enterprise license [configured on the Lab -side](/memgraph-lab/configuration#adding-memgraph-enterprise-license). +side](/memgraph-lab/configuration#adding-memgraph-enterprise-license). @@ -166,7 +166,8 @@ access logs for enhanced security and accountability. Before using Query Sharing, make sure it’s properly [set up](#set-up-query-sharing). Once configured, you can learn how to: -- [Create a query share](#create-a-query-share) +- [Create a query share](#create-a-query-share) +- [Create a parameterized query share using query params](#create-a-parameterized-query-share-using-query-params) - [View query share history](#view-query-share-history) - [Access and view a query share](#access-and-view-a-query-share) @@ -230,15 +231,96 @@ creator can also select which query results to show first. This is particularly useful when sharing a multi-query that involves setup queries followed by a graph algorithm whose results are to be displayed first. +The creator can also choose whether the query will auto-run when +opened, or allow the viewer to decide whether to run the query, +add it to a collection, or dismiss it. Upon creation, the user receives a URL that can be shared with other team members who have access to the same Lab and Memgraph instance. -![](/pages/data-visualization/lab-user-manual/query-sharing/2_sharequery_1.png) +![](/pages/data-visualization/lab-user-manual/query-sharing/query-share-query-setup.png) -![](/pages/data-visualization/lab-user-manual/query-sharing/3_sharequery_2.png) +![](/pages/data-visualization/lab-user-manual/query-sharing/query-share-configuration.png) -![](/pages/data-visualization/lab-user-manual/query-sharing/4_sharequery_3.png) +![](/pages/data-visualization/lab-user-manual/query-sharing/query-share-url.png) + +### Create a parameterized query share using query params + +Cypher query parameters are useful for creating a single query share +that acts as a template. With this approach, you can change the values +used in the query directly from the query share URL—without needing +to create a separate query share for every combination of values. + +{

Example scenario

} + +Let’s say you have a graph where one type of node is labeled `Country`. +You might start with a basic query that returns neighboring nodes +for a specific country and limits the number of results: + +``` +MATCH (n)-[e]-(m) +WHERE n.name = "France" +RETURN n, e, m +LIMIT 10; +``` + +If you wanted to share a similar query for Germany or change the result +limit, you'd traditionally need to create separate query shares, +such as: + +* `http://?shareId=100` (name: France, limit: 10) +* `http://?shareId=200` (name: Germany, limit: 100) +* `http://?shareId=300` (name: Spain, limit: 10) + +This leads to multiple shares for what is essentially the same query +logic. + +{

Using query parameters

} + +Instead, you can use Cypher parameters to generalize the query. +Here’s a parameterized version using `name` and `limit`: + +``` +// Cypher query: +MATCH (n)-[e]-(m) +WHERE n.name = $name +RETURN n, e, m +LIMIT toInteger($limit); + +// Params: { "name": "France", "limit": "10" } +``` + +![](/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-query.png) + +![](/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-params.png) + +You can now share one query and pass values dynamically through +the URL using the following format: + +* `http://......&shareParams=:` + +For example: + +* `http://?shareId=100&shareParams=name:France&shareParams=limit:10` (name: France, limit: 10) +* `http://?shareId=100&shareParams=name:Germany&shareParams=limit:100` (name: Germany, limit: 100) +* `http://?shareId=100&shareParams=name:Spain&shareParams=limit:10` (name: Spain, limit: 10) + +![](/pages/data-visualization/lab-user-manual/query-sharing/query-share-url-params.png) + +Each link uses the same `shareId`, but overrides the parameters +using the URL. If a parameter is not provided in the URL, the +default value (as set during query creation) will be used. + + + +All query parameters passed through the URL are interpreted as +strings. If your query expects another type (like an integer), +you must cast it appropriately. + +In the example above, we use `toInteger($limit)` to convert the +limit parameter. + + ### View query share history diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/2_sharequery_1.png b/public/pages/data-visualization/lab-user-manual/query-sharing/2_sharequery_1.png deleted file mode 100644 index af0557262..000000000 Binary files a/public/pages/data-visualization/lab-user-manual/query-sharing/2_sharequery_1.png and /dev/null differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/3_sharequery_2.png b/public/pages/data-visualization/lab-user-manual/query-sharing/3_sharequery_2.png deleted file mode 100644 index 29ba22b73..000000000 Binary files a/public/pages/data-visualization/lab-user-manual/query-sharing/3_sharequery_2.png and /dev/null differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/4_sharequery_3.png b/public/pages/data-visualization/lab-user-manual/query-sharing/4_sharequery_3.png deleted file mode 100644 index 12da52ac9..000000000 Binary files a/public/pages/data-visualization/lab-user-manual/query-sharing/4_sharequery_3.png and /dev/null differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-configuration.png b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-configuration.png new file mode 100644 index 000000000..fa3d2e854 Binary files /dev/null and b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-configuration.png differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-query-setup.png b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-query-setup.png new file mode 100644 index 000000000..f175b15d9 Binary files /dev/null and b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-query-setup.png differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-params.png b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-params.png new file mode 100644 index 000000000..4de10f3e8 Binary files /dev/null and b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-params.png differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-query.png b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-query.png new file mode 100644 index 000000000..fe5bfaf42 Binary files /dev/null and b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-template-query.png differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-url-params.png b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-url-params.png new file mode 100644 index 000000000..c95208b2a Binary files /dev/null and b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-url-params.png differ diff --git a/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-url.png b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-url.png new file mode 100644 index 000000000..519ee763e Binary files /dev/null and b/public/pages/data-visualization/lab-user-manual/query-sharing/query-share-url.png differ