Skip to content

Enums Don't Properly Serialize In Aggregation Pipeline Facet [DATAMONGO-2635] #3462

@spring-projects-issues

Description

@spring-projects-issues

gtomassi opened DATAMONGO-2635 and commented

When performing a search using an enum in the match stage of an aggregation, it works as a standalone aggregation, but the exact same aggregation fails inside of a facet with multiple of them.

In a standalone aggregation, it properly serializes the enum into a string. The spring driver logs a query that looks like

{ "$match" : { "value" : { "$in" : [ "FOO" ] } } }

 When the same aggregation is put inside a facet, the spring driver logs a query that looks like

{ "$match" : { "value" : { "$in" : [ { "$java" : FOO } ] } } }

Thus is it not serializing the enum in the expected way. 

The underlying mongo driver then throws:

"org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class [enum class]"

 


Affects: 3.0.4 (Neumann SR4)

Referenced from: pull request #890

Backported to: 3.1.1 (2020.0.1)

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions