Querying an Enum Value

Hi There -

I was curious if there were any examples on how to query an enum value using the QueryComponent. I’m having a bit of trouble:

Query.field("aggregationType").equalsValue(MetricExtractorProto.AggregationType.NONE)
Query.field("aggregationType").equalsValue(MetricExtractorProto.AggregationType.NONE.name)
Query.field("aggregationType").equalsValue(MetricExtractorProto.AggregationType.NONE.ordinal)

Any of these seem to throw an exception

com.apple.foundationdb.record.RecordCoreException: Comparison value of incorrect type
or
com.apple.foundationdb.record.RecordCoreException: Tried to compare non-comparable object class com.google.protobuf.Descriptors$EnumValueDescriptor

For now I’m just running a post-query filter so this isn’t blocking by any means.

It looks like all our tests / examples use an index to match the enum value. We don’t have one for evaluating against a loaded record. And that doesn’t (always?) work.

I’ll create a GitHub issue for this.

Awesome, thanks for the reply!