For the Java enumeration type, I find out that there are two solutions for MongoDB: serialization and using Jacksons ObjectMapper . Can MongoRepository work with enum data type with any of these approaches or should I write a custom repository?
Yes, Spring Data MongoDB supports enumerations. Just use them in your domain model.
Spring Mongodb data can serialize enum into a string using the enumeration name as a value. Let's say he uses the second approach from the article http://www.vineetmanohar.com/2010/01/3-ways-to-serialize-java-enums/ . IMHO this should not be taken seriously, because the only correct way to store enums in a database is approach number 3 from the same article, let me cite it: "This approach includes assigning an explicit user value for each enumeration constant and defining toValue () and fromValue () for listing for serialization and deserialization. ". So, Spring Data Mongodb does not support enumerations.