collection
collection copied to clipboard
where的使用
请问想进行where的条件筛选怎么做 func TestBaseCollection_Where(t *testing.T) { a := []map[string]interface{}{ {"name": "mike", "sex": 0}, {"name": "Mary", "sex": 1}, {"name": "Jane", "sex": 2}, }
fmt.Println(Collect(a).Where("sex", 1).ToMapArray())
}
比如想筛选sex大于1的数据
@stepGitHub 已修复。更新下master最新代码。
fmt.Println(Collect(a).Where("sex", ">", 1).ToMapArray())