This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
No announcement yet.
Spring MongoDB: Save a collection (Set, List..) in bulk?Page Title Module
The short answer is no. But not because of Spring Data, but because bulk upserts in Mongo are not supported. I believe it is a JIRA/Feature that might show up later in future versions of Mongo.
I have had this issue before myself with Mongo, no Spring Data usage. And I always had to really think about what I wanted done and come up with either a different document model, or another alternative.
For instance, in one case, instead of upserting different elements in a collection, I would update the entire collection. So I would get the document, get the collection and modify it in code, then do a $set on the collection to the new version of it. It will still be an update statement which allows for WriteConcerns rather than a full document replacement in the database.
Hope that helps, and sorry almost a month since you first posted this, so you probably already came up with an alternative.