当我在MongoDB中存储某些东西时,它是一个键/值的映射。所以当我检索它时:
JSON:
{
"_id": "d13d5667-e003-4f5f-ba6f-99848d994feb",
"_class": "org.blah.asset.Asset",
"metadata": {
"name": "Hello",
"status": "Draft"
},
"attributes": {
"headline": "Header",
"body": "body"
},
"something": "awesome"
}
爪哇:
@Document(collection="Assets")
public class AssetSearchResult {
@Id
private String id;
@org.springframework.data.mongodb.core.mapping.Field("metadata.name")
private String name;
@org.springframework.data.mongodb.core.mapping.Field("something")
private String status;
...generic getters/setters
"状态"字段设置为" awesome"如预期的那样,但名称字段为空。
Spring是否支持此功能(使用 spring-data-mongodb-1.6.2.RELEASE )?
由于