@@ -1038,11 +1038,13 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10381038 * <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
10391039 * Type Conversion"</a> for more details.
10401040 * <p/>
1041- * <p/>
10421041 * 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.
10431044 *
10441045 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
10451046 * @return the inserted object.
1047+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
10461048 */
10471049 <T > Mono <T > insert (T objectToSave );
10481050
@@ -1053,10 +1055,13 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10531055 * configured otherwise, an instance of {@link MappingMongoConverter} will be used.
10541056 * <p/>
10551057 * 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.
10561060 *
10571061 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
10581062 * @param collectionName name of the collection to store the object in. Must not be {@literal null}.
10591063 * @return the inserted object.
1064+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
10601065 */
10611066 <T > Mono <T > insert (T objectToSave , String collectionName );
10621067
@@ -1098,7 +1103,6 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10981103 * <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
10991104 * Type Conversion"</a> for more details.
11001105 * <p/>
1101- * <p/>
11021106 * Insert is used to initially store the object into the database. To update an existing object use the save method.
11031107 *
11041108 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1145,9 +1149,12 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
11451149 * property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See
11461150 * <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
11471151 * Type Conversion"</a> for more details.
1152+ * <p />
1153+ * The {@code objectToSave} must not be collection-like.
11481154 *
11491155 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
11501156 * @return the saved object.
1157+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
11511158 */
11521159 <T > Mono <T > save (T objectToSave );
11531160
@@ -1167,6 +1174,7 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
11671174 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
11681175 * @param collectionName name of the collection to store the object in. Must not be {@literal null}.
11691176 * @return the saved object.
1177+ * @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
11701178 */
11711179 <T > Mono <T > save (T objectToSave , String collectionName );
11721180
0 commit comments