?category=fruit)Query GET /items?category=fruit lọc các bản ghi có category khớp. Bản ghi gồm name và category.
Lệnh: CREATE <name> <category>, FILTER <category>.
Input:
CREATE Apple fruit
CREATE Carrot veg
FILTER fruit
Output:
{"status":200,"count":1,"items":[{"id":1,"name":"Apple","category":"fruit"}]}
Mỗi dòng CREATE <name> <category> hoặc FILTER <category>.
Số lệnh ≤ 200.
Với FILTER in {"status":200,"count":<n>,"items":[...]} gồm các bản ghi khớp category, theo id tăng dần.
Ví dụ:
Đầu vào:
CREATE Apple fruit
CREATE Carrot veg
FILTER fruit
Đầu ra:
{"status":200,"count":1,"items":[{"id":1,"name":"Apple","category":"fruit"}]}Giải thích:
Đang tải editor...