I have the following set of data on the Note model. Currently, I am using the Postgres for the database. Below are two different records on the Notes
table.
id: 1,
name: 'First Note',
items: [{description: 'First Note'}, {description: 'PM1 Second Note'}]
id: 2,
name: 'Second Note',
items: [{description: 'Second Note'}, {description: 'PM2 Second Note'}]
id: 3,
name: 'Third Note',
items: [{description: 'Third Note'}, {description: 'Invalid Second Note'}]
How do I query json
field (items) such that I get all the notes with the value PM
on the description field i.e the query should return notes with id 1 and 2 from the above example?