がに豆(ChildDocument)のリストを含む文書(parentDocumentではを)読んでは動作しません。そしてこれらの豆、私は値を変更するために特定のフィールド(の内容)だけを変換する必要があります。 mongoDbを読み込んでbeanをロードするだけで、mongodbには変更を保存しません。例えば春・データのMongoDBコンバータは、私が必要
:
@Document(collection = "parent")
class ParentDocument {
@Id
String id;
List<ChildDocument> children;
}
@Document
class ChildDocument {
@Id
String id;
// Modify the content reading in the database before storing the result in the java bean
String content;
}
私はChildDocumentにコンバータを使用しようとするが、コンバータはChildDocumentなどの組み込み文書に使用されていないので、それが動作しない(と思います?)。
誰かが私を助け、これを行うにはクリーンな解決策がありますか?
おかげ
あなたは今まで何を試してみましたか? –