@@ -1038,11 +1038,13 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1038
1038
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
1039
1039
* Type Conversion"</a> for more details.
1040
1040
* <p/>
1041
- * <p/>
1042
1041
* Insert is used to initially store the object into the database. To update an existing object use the save method.
1042
+ * <p />
1043
+ * The {@code objectToSave} must not be collection-like.
1043
1044
*
1044
1045
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
1045
1046
* @return the inserted object.
1047
+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
1046
1048
*/
1047
1049
<T > Mono <T > insert (T objectToSave );
1048
1050
@@ -1053,10 +1055,13 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1053
1055
* configured otherwise, an instance of {@link MappingMongoConverter} will be used.
1054
1056
* <p/>
1055
1057
* Insert is used to initially store the object into the database. To update an existing object use the save method.
1058
+ * <p />
1059
+ * The {@code objectToSave} must not be collection-like.
1056
1060
*
1057
1061
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
1058
1062
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
1059
1063
* @return the inserted object.
1064
+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
1060
1065
*/
1061
1066
<T > Mono <T > insert (T objectToSave , String collectionName );
1062
1067
@@ -1098,7 +1103,6 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1098
1103
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
1099
1104
* Type Conversion"</a> for more details.
1100
1105
* <p/>
1101
- * <p/>
1102
1106
* Insert is used to initially store the object into the database. To update an existing object use the save method.
1103
1107
*
1104
1108
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1145,9 +1149,12 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1145
1149
* property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See
1146
1150
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
1147
1151
* Type Conversion"</a> for more details.
1152
+ * <p />
1153
+ * The {@code objectToSave} must not be collection-like.
1148
1154
*
1149
1155
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
1150
1156
* @return the saved object.
1157
+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
1151
1158
*/
1152
1159
<T > Mono <T > save (T objectToSave );
1153
1160
@@ -1167,6 +1174,7 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1167
1174
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
1168
1175
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
1169
1176
* @return the saved object.
1177
+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
1170
1178
*/
1171
1179
<T > Mono <T > save (T objectToSave , String collectionName );
1172
1180
0 commit comments