neo4j_bolt 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/README.md +17 -1
- data/lib/neo4j_bolt/version.rb +1 -1
- data/neo4j_bolt.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57cb820dc2f181457f76fa50f72a00d0712ba568aab86af0c156ed072ec05966
|
4
|
+
data.tar.gz: 7a1fde38c4c94a666226ec5a7136eae9187b592428345ae9178e69aff3b82231
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bba294fea8355bb36e4f73cd9f0abfaeb44289dea42104c477350a7bdd6777987335181fa8cd6732dc388518a058abf57503bbcf2ec1fe8ffc9e0dcd7904f7c
|
7
|
+
data.tar.gz: a3a3584d8e1edcb24472b7811dd603e416ff45ed09f49f65bbfbd10154b12b197cdbf1752dbfc89a28f81f016cc99746c18836fbd187437889f51b21c4592471
|
data/README.md
CHANGED
@@ -36,7 +36,23 @@ In order to use this gem, you need a running Neo4j database. You can start one u
|
|
36
36
|
docker run --rm --env NEO4J_AUTH=none --publish 7687:7687 neo4j:4.4-community
|
37
37
|
```
|
38
38
|
|
39
|
-
|
39
|
+
### Running queries
|
40
|
+
|
41
|
+
Use `neo4j_query` to run a query and receive all results:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
entries = neo4j_query("MATCH (n) RETURN n")
|
45
|
+
```
|
46
|
+
Alternatively, specify a block to make use of Neo4j's streaming capabilities and receive entries one by one:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
neo4j_query("MATCH (n) RETURN n") do |entry|
|
50
|
+
# entry['n'] is your node
|
51
|
+
end
|
52
|
+
```
|
53
|
+
Using streaming avoids memory hog since it prevents having to read all entries into memory before handling them.
|
54
|
+
|
55
|
+
Use `neo4j_query_expect_one` if you want to make sure there's exactly one entry to be returned. If there's zero, two, or more results, this will raise a `ExpectedOneResultError`.
|
40
56
|
|
41
57
|
## Development
|
42
58
|
|
data/lib/neo4j_bolt/version.rb
CHANGED
data/neo4j_bolt.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ["micha.specht@gmail.com"]
|
8
8
|
spec.licenses = ['GPL-3.0-only']
|
9
9
|
|
10
|
-
spec.summary = "A
|
10
|
+
spec.summary = "A Neo4j/Bolt driver written in pure Ruby"
|
11
11
|
spec.homepage = "https://github.com/specht/neo4j_bolt"
|
12
12
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j_bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Specht
|
@@ -69,5 +69,5 @@ requirements: []
|
|
69
69
|
rubygems_version: 3.3.5
|
70
70
|
signing_key:
|
71
71
|
specification_version: 4
|
72
|
-
summary: A
|
72
|
+
summary: A Neo4j/Bolt driver written in pure Ruby
|
73
73
|
test_files: []
|