@@ -260,9 +260,21 @@ default SessionScoped withSession(Supplier<ClientSession> sessionProvider) {
260
260
261
261
/**
262
262
* Create an uncapped collection with a name based on the provided entity class.
263
+ * <p>
264
+ * This method derives {@link CollectionOptions} from the given {@code entityClass} using
265
+ * {@link org.springframework.data.mongodb.core.mapping.Document} and
266
+ * {@link org.springframework.data.mongodb.core.mapping.TimeSeries} annotations to determine:
267
+ * <ul>
268
+ * <li>Collation</li>
269
+ * <li>TimeSeries time and meta fields, granularity and {@code expireAfter}</li>
270
+ * </ul>
271
+ * Any other options such as change stream options, schema-based details (validation, encryption) are not considered
272
+ * and must be provided through {@link #createCollection(Class, CollectionOptions)} or
273
+ * {@link #createCollection(String, CollectionOptions)}.
263
274
*
264
275
* @param entityClass class that determines the collection to create.
265
276
* @return the created collection.
277
+ * @see #createCollection(Class, CollectionOptions)
266
278
*/
267
279
<T > MongoCollection <Document > createCollection (Class <T > entityClass );
268
280
@@ -998,7 +1010,8 @@ default <T> List<T> findDistinct(Query query, String field, String collection, C
998
1010
* @see Update
999
1011
* @see AggregationUpdate
1000
1012
*/
1001
- <T > @ Nullable T findAndModify (Query query , UpdateDefinition update , FindAndModifyOptions options , Class <T > entityClass );
1013
+ <T > @ Nullable T findAndModify (Query query , UpdateDefinition update , FindAndModifyOptions options ,
1014
+ Class <T > entityClass );
1002
1015
1003
1016
/**
1004
1017
* Triggers <a href="https://docs.mongodb.org/manual/reference/method/db.collection.findAndModify/">findAndModify </a>
@@ -1021,8 +1034,8 @@ default <T> List<T> findDistinct(Query query, String field, String collection, C
1021
1034
* @see Update
1022
1035
* @see AggregationUpdate
1023
1036
*/
1024
- <T > @ Nullable T findAndModify (Query query , UpdateDefinition update , FindAndModifyOptions options , Class < T > entityClass ,
1025
- String collectionName );
1037
+ <T > @ Nullable T findAndModify (Query query , UpdateDefinition update , FindAndModifyOptions options ,
1038
+ Class < T > entityClass , String collectionName );
1026
1039
1027
1040
/**
1028
1041
* Triggers
@@ -1102,7 +1115,8 @@ default <T> List<T> findDistinct(Query query, String field, String collection, C
1102
1115
* as it is after the update.
1103
1116
* @since 2.1
1104
1117
*/
1105
- default <T > @ Nullable T findAndReplace (Query query , T replacement , FindAndReplaceOptions options , String collectionName ) {
1118
+ default <T > @ Nullable T findAndReplace (Query query , T replacement , FindAndReplaceOptions options ,
1119
+ String collectionName ) {
1106
1120
1107
1121
Assert .notNull (replacement , "Replacement must not be null" );
1108
1122
return findAndReplace (query , replacement , options , (Class <T >) ClassUtils .getUserClass (replacement ), collectionName );
@@ -1154,8 +1168,8 @@ default <T> List<T> findDistinct(Query query, String field, String collection, C
1154
1168
* {@link #getCollectionName(Class) derived} from the given replacement value.
1155
1169
* @since 2.1
1156
1170
*/
1157
- default <S , T > @ Nullable T findAndReplace (Query query , S replacement , FindAndReplaceOptions options , Class < S > entityType ,
1158
- Class <T > resultType ) {
1171
+ default <S , T > @ Nullable T findAndReplace (Query query , S replacement , FindAndReplaceOptions options ,
1172
+ Class <S > entityType , Class < T > resultType ) {
1159
1173
1160
1174
return findAndReplace (query , replacement , options , entityType ,
1161
1175
getCollectionName (ClassUtils .getUserClass (entityType )), resultType );
0 commit comments