Closed
Description
- add dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>
- add Friend class
import lombok.Data;
import lombok.experimental.Accessors;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.MongoId;
@Document(collection = "friend")
@Data
@Accessors(chain = true)
public class Friend {
@MongoId
private ObjectId id;
}
- startup exception
springboot 2.4.1 has no problem starting
If the type of the id field of the Friend class is changed to String, the startup is OK
**Test project address is https://github.com/star4j/test.git