0
私はこのようになりdetails
JSON列を持ついくつかのUser
レコードを持っている:私はid
が2
あるすべてのレコードを照会するにはどうすればよいポストグラムでJSONを使用すると、ネストされた配列をどのようにクエリできますか?
User.create(details: {accounts: [{name: 'one', id: 1}, {name: 'two', id: 2}])
User.create(details: {accounts: [{name: 'three', id: 3}, {name: 'two', id: 2}])
User.create(details: {accounts: [{name: 'three', id: 3}, {name: 'four', id: 4}])
を?
ここでチェックhttps://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query ORここのhttp://edgeguides.rubyonrailsを。 org/active_record_postgresql.html#json – LHH