CREATE TABLE fruits (
  id int,
  items jsonb
);
INSERT INTO fruits VALUES (1, '["apple"]');
INSERT INTO fruits VALUES (2, '["banana", "apple"]');
INSERT INTO fruits VALUES (3, '["peach"]');
CREATE INDEX pgroonga_index ON fruits
  USING pgroonga (items pgroonga_jsonb_ops);
DELETE FROM fruits WHERE id = 1;
VACUUM;
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = off;
SELECT id, items
  FROM fruits
 WHERE items &` 'string == "apple"'
 ORDER BY id;
 id |        items        
----+---------------------
  2 | ["banana", "apple"]
(1 row)

DROP TABLE fruits;
