db icon indicating copy to clipboard operation
db copied to clipboard

db.And is not a type

Open ringrid opened this issue 9 years ago • 2 comments

I'm using upper.io/db.v3, my code example:

        cond := db.And{
		db.Cond{"col1": "col1"},
		db.Or{
			db.Cond{"col2": "x1"},
			db.Cond{"col2": "x2"},
		},
	}
	err = sess.Collection("mytable").Find(cond).All(&tbs)

it tell me "db.And is not a type"

I tried to another method:

        cond := db.And{
		db.Cond{"col1": "col1"},
		db.Or{
			db.Cond{"col2": "x1"},
			db.Cond{"col2": "x2"},
		},
	}
	sess.SelectFrom("tables").Where(cond)

it's same error.

please tell me how do I ?

ringrid avatar Apr 15 '17 18:04 ringrid

db.And()

VojtechVitek avatar Apr 15 '17 18:04 VojtechVitek

sorry my mistake... lol...

ringrid avatar Apr 15 '17 18:04 ringrid