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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25b0be124fa4f41c0d4fd9326c5711ca7d094ce6
4
- data.tar.gz: a2aefe6c77b194f4296ae74efed3365b2bdb1aa1
3
+ metadata.gz: 603fa5b52e151a255cb6af0c99ee8a13442cfb58
4
+ data.tar.gz: c2045779a04c9d9680ed3ff4ff811f5f6f42ba3d
5
5
  SHA512:
6
- metadata.gz: 131b612496659cfc56fac4d950621e4e9ce0227a910c35b502e9234507df67485e75840abe918caf9a36da1fa306ac41db5a51787393daf9ef98881ce952b65f
7
- data.tar.gz: e36089a513af01b0651c97494fa16efb7ebc490253f5fb2991185445b1b83e93564d6890e5858e4c36e6da4b4e3866e47db803d0d1ca0b492224f87130be92e4
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.
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = "3.0.0.alpha.8"
3
+ VERSION = "3.0.0.alpha.9"
4
4
  end
5
5
  end
@@ -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
- "n.#{k}=#{escape_value(conditions[k])}"
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.8
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-01-26 00:00:00.000000000 Z
11
+ date: 2014-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty