google app引擎数据存储区使用“ in”运算符进行查询

Using Query in App Engine Datastore, how do I specify to fetch keys that match a property with variable values?

var Person struct {
   name string
   department string  
}

//Query
q := datastore.NewQuery("Person").Filter("department = ", "department1").KeysOnly()

In the above query, instead of "=" operator, I want "IN" operator to specify more than 1 department value i.e fetch all person keys who belong to department1, department2, department3 etc.

Is this possible with 1 Query? Or do I need to make 1 query for each department?

Other runtimes allow "IN" operator for datastore queries. It is, however, just a convenience: under the hood, the datastore makes individual queries for each element in the list.

If you have a relatively small number of entities, it may be more efficient to retrieve all of them and then filter the results based on the "department" property, rather than issues N queries to search for N possible departments.