我尝试运行过滤 KeyProperty 的查询。我目前使用的dart gcloud包是版本:0.2.0+8
所以对于这样的模型:
@Kind(idType: IdType.String)
class Foo extends Model {
@ModelKeyProperty(indexed: true, required: true)
Key bar;
}
我想运行这样的查询:
Query query = new Query(db, Foo);
query.filter('bar =', someKey);
var result = query.run();
但我收到以下错误:
Uncaught error in request handler: ApplicationError: Cannot encode unsupported Key type.
#0 Codec.encodeProperty (package:appengine/src/api_impl/raw_datastore_v3_impl.dart:319:7)
#1 DatastoreV3RpcImpl.query (package:appengine/src/api_impl/raw_datastore_v3_impl.dart:527:43)
#2 Query.run.<anonymous closure> (package:gcloud/src/db/db.dart:232:28)