google app engine datastore Go Query with "in" operator -


using query in app engine datastore, how specify fetch keys match property variable values?

var person struct {    name string    department string   }  //query q := datastore.newquery("person").filter("department = ", "department1").keysonly() 

in above query, instead of "=" operator, want "in" operator specify more 1 department value i.e fetch person keys belong department1, department2, department3 etc.

is possible 1 query? or need make 1 query each department?

other runtimes allow "in" operator datastore queries. is, however, convenience: under hood, datastore makes individual queries each element in list.

if have relatively small number of entities, may more efficient retrieve of them , filter results based on "department" property, rather issues n queries search n possible departments.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -