add map key operator support in Where function for gdb
@@ -434,6 +434,14 @@ func TestModel_Where(t *testing.T) {
}
gtest.Assert(result["id"].Int(), 3)
})
+ // map key operator
+ gtest.Case(t, func() {
+ result, err := db.Table("user").Where(g.Map{"id>" : 1, "id<" : 3}).One()
+ if err != nil {
+ gtest.Fatal(err)
+ }
+ gtest.Assert(result["id"].Int(), 2)
+ })
// struct
gtest.Case(t, func() {
type User struct {
