Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,14 @@ keyspace
lTrim
labelsList
len
listGraphs
list_graphs
lon
malte
matchRegEx
maxCost
maxLen
memoryUsage
multithreaded
myGraph
myPassword
Expand Down Expand Up @@ -270,6 +273,7 @@ schemas
shortestPath
signum
slowlog
slowLog
sourceNode
sqrt
stDev
Expand Down
48 changes: 48 additions & 0 deletions commands/graph.list.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,54 @@ parent: "Commands"

Lists all graph keys in the keyspace.

## Examples

{% capture shell_0 %}
GRAPH.LIST
{% endcapture %}

{% capture python_0 %}
from falkordb import FalkorDB
db = FalkorDB(host='localhost', port=6379)
graphs = db.list_graphs()
print(graphs)
{% endcapture %}

{% capture javascript_0 %}
import { FalkorDB } from 'falkordb';
const db = await FalkorDB.connect({
socket: { host: 'localhost', port: 6379 }
});
const graphs = await db.list();
console.log(graphs);
{% endcapture %}

{% capture java_0 %}
import com.falkordb.*;

Driver driver = FalkorDB.driver("localhost", 6379);
List<String> graphs = driver.listGraphs();
System.out.println(graphs);
{% endcapture %}

{% capture rust_0 %}
use falkordb::{FalkorClientBuilder, FalkorConnectionInfo};

let connection_info: FalkorConnectionInfo = "falkor://127.0.0.1:6379"
.try_into()
.expect("Invalid connection info");
let client = FalkorClientBuilder::new()
.with_connection_info(connection_info)
.build()
.expect("Failed to build client");
let graphs = client.list_graphs();
println!("{:?}", graphs);
{% endcapture %}

{% include code_tabs.html id="list_tabs" shell=shell_0 python=python_0 javascript=javascript_0 java=java_0 rust=rust_0 %}

### Sample Output

```sh
127.0.0.1:6379> GRAPH.LIST
2) G
Expand Down
30 changes: 26 additions & 4 deletions commands/graph.memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,38 @@ The command returns an array of key-value pairs, where each pair represents a sp
## Examples

### Basic Usage
```bash

{% capture shell_0 %}
GRAPH.MEMORY USAGE myGraph
```
{% endcapture %}

{% capture javascript_0 %}
import { FalkorDB } from 'falkordb';
const db = await FalkorDB.connect({
socket: { host: 'localhost', port: 6379 }
});
const graph = db.selectGraph('myGraph');
const memoryInfo = await graph.memoryUsage();
console.log(memoryInfo);
{% endcapture %}

{% include code_tabs.html id="memory_basic_tabs" shell=shell_0 javascript=javascript_0 %}

### With Sampling
```bash

{% capture shell_1 %}
GRAPH.MEMORY USAGE myGraph SAMPLES 500
```
{% endcapture %}

{% capture javascript_1 %}
const memoryInfo = await graph.memoryUsage({ samples: 500 });
console.log(memoryInfo);
{% endcapture %}

{% include code_tabs.html id="memory_samples_tabs" shell=shell_1 javascript=javascript_1 %}

### Sample Output

```sh
127.0.0.1:6379> GRAPH.MEMORY USAGE flights
1) "total_graph_sz_mb"
Expand Down
17 changes: 16 additions & 1 deletion commands/graph.ro-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ GRAPH.RO_QUERY us_government "MATCH (p:president)-[:born]->(:state {name:'Hawaii
graph.ro_query("MATCH (p:president)-[:born]->(:state {name:'Hawaii'}) RETURN p")
{% endcapture %}

{% include code_tabs.html id="tabs_0" shell=shell_0 python=python_0 %}
{% capture javascript_0 %}
const result = await graph.ro_query("MATCH (p:president)-[:born]->(:state {name:'Hawaii'}) RETURN p");
console.log(result);
{% endcapture %}

{% capture java_0 %}
ResultSet result = graph.readOnlyQuery("MATCH (p:president)-[:born]->(:state {name:'Hawaii'}) RETURN p");
System.out.println(result);
{% endcapture %}

{% capture rust_0 %}
let result = graph.ro_query(r#"MATCH (p:president)-[:born]->(:state {name:'Hawaii'}) RETURN p"#).execute().await?;
println!("{:?}", result);
{% endcapture %}

{% include code_tabs.html id="tabs_0" shell=shell_0 python=python_0 javascript=javascript_0 java=java_0 rust=rust_0 %}

Query-level timeouts can be set as described in [the configuration section](/configuration#timeout).
42 changes: 39 additions & 3 deletions commands/graph.slowlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,36 @@ Each item in the list has the following structure:
3. The issued query.
4. The amount of time needed for its execution, in milliseconds.

## Examples

### Get slowlog

{% capture shell_0 %}
GRAPH.SLOWLOG graph_id
{% endcapture %}

{% capture python_0 %}
from falkordb import FalkorDB
db = FalkorDB(host='localhost', port=6379)
graph = db.select_graph('graph_id')
slowlog = graph.slowlog()
print(slowlog)
{% endcapture %}

{% capture javascript_0 %}
import { FalkorDB } from 'falkordb';
const db = await FalkorDB.connect({
socket: { host: 'localhost', port: 6379 }
});
const graph = db.selectGraph('graph_id');
const slowlog = await graph.slowLog();
console.log(slowlog);
{% endcapture %}

{% include code_tabs.html id="slowlog_tabs" shell=shell_0 python=python_0 javascript=javascript_0 %}

### Sample Output

```sh
GRAPH.SLOWLOG graph_id
1) 1) "1581932396"
Expand All @@ -28,10 +58,16 @@ GRAPH.SLOWLOG graph_id
4) "0.288"
```

To reset a graph's slowlog issue the following command:
### Reset slowlog

```sh
{% capture shell_1 %}
GRAPH.SLOWLOG graph_id RESET
```
{% endcapture %}

{% capture python_1 %}
graph.slowlog_reset()
{% endcapture %}

{% include code_tabs.html id="slowlog_reset_tabs" shell=shell_1 python=python_1 %}

Once cleared the information is lost forever.
Loading