This repository has been archived on 2022-04-14. You can view files and clone it, but cannot push or open issues or pull requests.
manual-en-US/chapter-05/6.iterate.md
2020-03-27 14:29:41 +08:00

268 B

5.6.Iterate records

Iterate, like Find, but handle objects one by one.

err := engine.Where("age > ? or name=?)", 30, "xlw").Iterate(new(Userinfo), func(i int, bean interface{})error{
    user := bean.(*Userinfo)
    //do somthing use i and user
})