neo4j-core 3.0.0.alpha.8 → 3.0.0.alpha.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/neo4j-core/version.rb +1 -1
- data/lib/neo4j/label.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 603fa5b52e151a255cb6af0c99ee8a13442cfb58
|
4
|
+
data.tar.gz: c2045779a04c9d9680ed3ff4ff811f5f6f42ba3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f26e769116c75daa0666eb77a2278c59e36652f195d2c4b81dcba47b5837028e216d30c8c1fb55fa096791c14f63da78dce00464eee059bc803c4ab4598655d
|
7
|
+
data.tar.gz: 0fcf3a37a9833e1c6d37d24173e8c895536a0f2cc0ea3e0201452b8f27a89038854481ece391016e6d66159b67d5d100c257837321549b76c254a475a346ca25
|
data/README.md
CHANGED
@@ -183,6 +183,16 @@ Example, Finding with order by on label :person
|
|
183
183
|
```
|
184
184
|
|
185
185
|
|
186
|
+
Conditions:
|
187
|
+
|
188
|
+
```ruby
|
189
|
+
# exact search
|
190
|
+
Neo4j::Label.query(:person, conditions: {name: 'andreas'}
|
191
|
+
|
192
|
+
# regular expression
|
193
|
+
Neo4j::Label.query(:person, conditions: {name: /AND.*/i})
|
194
|
+
```
|
195
|
+
|
186
196
|
### Transactions
|
187
197
|
|
188
198
|
By default each Neo4j operation is wrapped in an transaction.
|
data/lib/neo4j-core/version.rb
CHANGED
data/lib/neo4j/label.rb
CHANGED
@@ -86,7 +86,13 @@ module Neo4j
|
|
86
86
|
def condition_to_cypher(query)
|
87
87
|
conditions = query[:conditions]
|
88
88
|
" WHERE " + conditions.keys.map do |k|
|
89
|
-
|
89
|
+
value = conditions[k]
|
90
|
+
if value.is_a? Regexp
|
91
|
+
pattern = (value.casefold? ? "(?i)" : "") + value.source
|
92
|
+
"n.#{k}=~#{escape_value(pattern.gsub(/\\/, '\\\\\\'))}"
|
93
|
+
else
|
94
|
+
"n.#{k}=#{escape_value(conditions[k])}"
|
95
|
+
end
|
90
96
|
end.join(" AND ")
|
91
97
|
end
|
92
98
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.alpha.
|
4
|
+
version: 3.0.0.alpha.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Ronge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|