Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
167 views
in Technique[技术] by (71.8m points)

Updating multi level Embedded document in Mongo using reactivemongotemplate

I have an embedded document. How can I update the multilevel document? At the time of insert, using Document to store the document. When updating the embedded document with update.set(), I can only do a string and not as an embedded document(storing it as null other than string).

The obj.getEmbeddedDocument() is returning me an object. I am able to use Gson library to update, but that is getting stored as String instead of embedded document.

Any suggestions?

[{"test1":[{"inside1":"value","inside2":"value"},
 {"inside11":"value","inside21":"value"}]},

 {"test2":[{"inside1":"value","inside2":"value"},
 {"inside11":"value","inside21":"value"}]}]
question from:https://stackoverflow.com/questions/66057363/updating-multi-level-embedded-document-in-mongo-using-reactivemongotemplate

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...