java mongodb save,Java MongoDB一次保存多个文档
生活随笔
收集整理的這篇文章主要介紹了
java mongodb save,Java MongoDB一次保存多个文档
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
I Have a list of updated objects/documents i need save all the objects in the list at once.
I saw save() in MongoTemplate but it can take single document at a time.
Is there any way to save multiple documents at once or i need to call save in loop ?
解決方案
Thanks for all the help.
I was able to do it using Spring data MongoDB.
Spring data MongoDB's MongoRepository has many inbuilt methods.
org.springframework.data.mongodb.repository.MongoRepository.saveAll(Iterable entites)
is the one which i used to save multiple documents.
總結
以上是生活随笔為你收集整理的java mongodb save,Java MongoDB一次保存多个文档的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python梦幻西游鼠标偏移_PYTHO
- 下一篇: 为什么java单精度要f_为什么快速反平