二者本来应该是相同的值,但是每次查询都在变化,
@Id
@ApiModelProperty(value = "主键")
@Field(value = "_id")
var _id:ObjectId? = null
@NotEmpty(groups = [AddGroup::class], message = "id不能为空")
var id: String? = null
原来是这么记录的,直接改成String
@Id
@ApiModelProperty(value = "主键")
@Field(value = "_id")
var _id:String? = null
@NotEmpty(groups = [AddGroup::class], message = "id不能为空")
var id: String? = null
完事
标签:String,ObjectId,mongodb,value,查询,var,null,id From: https://www.cnblogs.com/qiudaozhang/p/17117186.html