id | country | capitol |
1 | USA | Washington DC |
2 | Japan | Tokyo |
3 | United Kingdom | London |
And you want to fetch data like this:
['Washington DC', 'Tokyo', 'London']
Then do this:
$capitols = $this->countries
->find()
->extract('capitol')
->toArray();