README.md in pgrel-0.1.1 vs README.md in pgrel-0.1.2

- old
+ new

@@ -1,6 +1,6 @@ -[![Build Status](https://travis-ci.org/palkan/pgrel.svg?branch=master)](https://travis-ci.org/palkan/pgrel) +[![Gem Version](https://badge.fury.io/rb/pgrel.svg)](https://rubygems.org/gems/pgrel) [![Build Status](https://travis-ci.org/palkan/pgrel.svg?branch=master)](https://travis-ci.org/palkan/pgrel) ## Pgrel ActiveRecord extension for querying hstore, array and jsonb. @@ -23,14 +23,14 @@ Query by key value: ```ruby Hstore.where.store(:tags, a: 1, b: 2) -#=> select * from hstores where tags->'a' = '1' and tags->'b' = '2' +#=> select * from hstores where tags @> '"a"=>"1","b"=>"2"' Hstore.where.store(:tags, a: [1, 2]) -#=> select * from hstores where tags->'a' in ('1', '2') +#=> select * from hstores where (tags @> '"a"=>"1"' or tags @> '"a"=>"2"') ``` Keys existence: ```ruby @@ -59,17 +59,17 @@ ### JSONB All queries for Hstore also available for JSONB. -**NOTE**. Querying by array value always resolves to `IN (...)` statement. +**NOTE**. Querying by array value always resolves to `(... or ...)` statement. Thus it's impossible to query json array value, e.g.: ```ruby Model.create!(tags: {main: ['a', 'b']}) Model.where.store(:tags, main: ['a', 'b']).empty? == true -#=> select * from models where tags->'main' in ('a', 'b') +#=> select * from models where (tags @> '{\"main\":\"a\"}' or tags @> '{\"main\":\"b\"}') ``` Path query: ```ruby