ProjectionOperation projectionOperation1 = Aggregation.project("uid", "userName", "userAvatar", "action", "objectType", "objectOthers",
"createdDt", "url_as", "userCopyUrl_as")
.andExpression("toString(objectId)").as("objectId")
.andExpression("toString(_id)").as("id")
.and(filter("userLikeUrl_as").as("item")
.by(ComparisonOperators.Eq.valueOf("item.valid").equalToValue(1))).as("userLikeUrl_as_list");
解决了,是因为返回的对象类型使用的是int,应该使用Integer才行,因为Integer允许为Null