flowquery 1.0.78 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/flowquery.min.js +1 -1
- package/dist/parsing/functions/round.d.ts +2 -0
- package/dist/parsing/functions/round.d.ts.map +1 -1
- package/dist/parsing/functions/round.js +32 -7
- package/dist/parsing/functions/round.js.map +1 -1
- package/dist/parsing/logic/case.d.ts.map +1 -1
- package/dist/parsing/logic/case.js +5 -1
- package/dist/parsing/logic/case.js.map +1 -1
- package/dist/parsing/parser.d.ts +6 -0
- package/dist/parsing/parser.d.ts.map +1 -1
- package/dist/parsing/parser.js +42 -6
- package/dist/parsing/parser.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -670,6 +670,7 @@ UNWIND ["a", "b", "a", "c"] AS s RETURN count(DISTINCT s) AS cnt // 3
|
|
|
670
670
|
| `size(list)` | Length of list or string | `size([1,2,3])` → `3` |
|
|
671
671
|
| `range(start, end)` | Inclusive integer range | `range(1,3)` → `[1,2,3]` |
|
|
672
672
|
| `round(n)` | Round to nearest integer | `round(3.7)` → `4` |
|
|
673
|
+
| `round(n, precision)` | Round to `precision` decimal places | `round(3.14159, 2)` → `3.14` |
|
|
673
674
|
| `rand()` | Random float 0–1 | `round(rand()*10)` |
|
|
674
675
|
| `log(n)` | Natural logarithm (base e) | `log(10)` → `2.302...` |
|
|
675
676
|
| `log10(n)` | Base-10 logarithm | `log10(1000)` → `3` |
|
|
@@ -854,6 +855,23 @@ WHERE 'Alice' IN COLLECT { MATCH (p)-[:KNOWS]->(f:Person) RETURN f.name }
|
|
|
854
855
|
RETURN p.name
|
|
855
856
|
```
|
|
856
857
|
|
|
858
|
+
**Bare-pattern shorthand:** `EXISTS` and `COUNT` also accept a graph pattern directly, without the `MATCH` keyword (with an optional trailing `WHERE`). `COLLECT` does not support this form because it needs a `RETURN` to know which value to collect.
|
|
859
|
+
|
|
860
|
+
```cypher
|
|
861
|
+
// EXISTS with a bare pattern
|
|
862
|
+
MATCH (p:Person)
|
|
863
|
+
WHERE EXISTS { (p)-[:KNOWS]->(:Person) }
|
|
864
|
+
RETURN p.name
|
|
865
|
+
|
|
866
|
+
// COUNT with a bare pattern, in RETURN
|
|
867
|
+
MATCH (p:Person)
|
|
868
|
+
RETURN p.name, COUNT { (p)-[:KNOWS]->(:Person) } AS friendCount
|
|
869
|
+
|
|
870
|
+
// COUNT with a bare pattern and inner WHERE
|
|
871
|
+
MATCH (p:Person)
|
|
872
|
+
RETURN p.name, COUNT { (p)-[:KNOWS]->(f:Person) WHERE f.age > 30 } AS closeFriends
|
|
873
|
+
```
|
|
874
|
+
|
|
857
875
|
**Node reference reuse across MATCH clauses:**
|
|
858
876
|
|
|
859
877
|
```cypher
|
|
@@ -992,6 +1010,7 @@ RETURN f.name, f.description, f.category
|
|
|
992
1010
|
│ ENDS WITH · NOT ENDS WITH │
|
|
993
1011
|
│ EXISTS { subquery } · NOT EXISTS { subquery } │
|
|
994
1012
|
│ COUNT { subquery } · COLLECT { subquery } │
|
|
1013
|
+
│ EXISTS { pattern } · COUNT { pattern } -- bare pattern │
|
|
995
1014
|
├─────────────────────────────────────────────────────────────┤
|
|
996
1015
|
│ EXPRESSIONS │
|
|
997
1016
|
├─────────────────────────────────────────────────────────────┤
|