Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where的使用 #2

Open
hubyao opened this issue Sep 21, 2019 · 1 comment
Open

where的使用 #2

hubyao opened this issue Sep 21, 2019 · 1 comment

Comments

@hubyao
Copy link

hubyao commented Sep 21, 2019

请问想进行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的数据

@chenhg5
Copy link
Owner

chenhg5 commented Sep 21, 2019

@StepGitHub 已修复。更新下master最新代码。

fmt.Println(Collect(a).Where("sex", ">", 1).ToMapArray())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants