Reputation: 3
I'm starting with Couchbase, because the feature of NoSQL and the implementation for the N1QL, similar as SQL syntax.
So, I'm trying to SELECT a value from array key, but there is no success... how can I filter these results?
SELECT players p FROM matches WHERE p. ???? = 'Aloh4'
Upvotes: 0
Views: 185
Reputation: 7414
SELECT players FROM matches WHERE 'Aloh4' IN OBJECT_NAMES(players);
OR
CREATE INDEX ix1 ON matches( DISTINCT ARRAY pname FOR pname IN OBJECT_NAMES(players) END); SELECT players FROM matches WHERE ANY pname IN OBJECT_NAMES(players) SATISFIES pname = 'Aloh4' END;
Upvotes: 2