简体   繁体   中英

Is there any way to update whole Entity in MongoDB?

I'm using Spring Data MongoDB and currently I'm wondering if there's any way to update whole entity like mongoTemplate.update(entityObject)? Because the usual way is to update properties one-by-one.. PS Code written in Java.

Right - the save() method does a full document replace. Because the database is schema-less, the concept of fields doesn't really exist apart from your document.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM