Consider this example. I am using lodash
'data': [ { 'category': { 'uri': '/categories/0b092e7c-4d2c-4eba-8c4e-80937c9e483d', 'parent': 'Food', 'name': 'Costco' }, 'amount': '15.0', 'debit': true }, { 'category': { 'uri': '/categories/d6c10cd2-e285-4829-ad8d-c1dc1fdeea2e', 'parent': 'Food', 'name': 'India Bazaar' }, 'amount': '10.0', 'debit': true }, { 'category': { 'uri': '/categories/d6c10cd2-e285-4829-ad8d-c1dc1fdeea2e', 'parent': 'Food', 'name': 'Sprouts' }, 'amount': '11.1', 'debit': true },
When i do
_.filter(summary.data, {'debit': true})
I return all objects.
what I want?
I need all the objects where category.parent == 'Food' , how can I do this?
I tried
_.filter(summary.data, {'category.parent': 'Food'})
and received
[]
javascript lodash
daydreamer Jun 13 '13 at 21:00 2013-06-13 21:00
source share