json-server icon indicating copy to clipboard operation
json-server copied to clipboard

Any way to filter data based on whether a field's value is in specified array?

Open remy727 opened this issue 1 year ago • 2 comments

products = [
  {
    "id": 1,
    "type": 'A'
  },
  {
    "id": 2
    "type": 'B'
  },
  {
    "id": 3,
    "type": 'A'
  },
  {
    "id": 4,
    "type": 'C'
  },
  {
    "id": 5,
    "type": 'C'
  },
]

Can I filter products based on whether type in ['A', 'B']?

remy727 avatar Jan 26 '24 16:01 remy727