@@ -198,33 +198,33 @@ class TypedCriteriaBuilder {
198
198
* See [MongoDB Query operator: $regex](https://docs.mongodb.com/manual/reference/operator/query/regex/)
199
199
* @see Criteria.regex
200
200
*/
201
- infix fun KProperty <* >.regex (re : String ) = addOperation { regex(re, null ) }
201
+ infix fun KProperty<String? >.regex (re : String ) = addOperation { regex(re, null ) }
202
202
203
203
/* *
204
204
* Creates a criterion using a $regex and $options operator.
205
205
*
206
206
* See [MongoDB Query operator: $regex](https://docs.mongodb.com/manual/reference/operator/query/regex/)
207
207
* @see Criteria.regex
208
208
*/
209
- fun KProperty <* >.regex (re : String , options : String? ) = addOperation { regex(re, options) }
209
+ fun KProperty<String? >.regex (re : String , options : String? ) = addOperation { regex(re, options) }
210
210
211
211
/* *
212
212
* Syntactical sugar for [isEqualTo] making obvious that we create a regex predicate.
213
213
* @see Criteria.regex
214
214
*/
215
- infix fun KProperty <* >.regex (re : Regex ) = addOperation { regex(re.toPattern()) }
215
+ infix fun KProperty<String? >.regex (re : Regex ) = addOperation { regex(re.toPattern()) }
216
216
217
217
/* *
218
218
* Syntactical sugar for [isEqualTo] making obvious that we create a regex predicate.
219
219
* @see Criteria.regex
220
220
*/
221
- infix fun KProperty <* >.regex (re : Pattern ) = addOperation { regex(re) }
221
+ infix fun KProperty<String? >.regex (re : Pattern ) = addOperation { regex(re) }
222
222
223
223
/* *
224
224
* Syntactical sugar for [isEqualTo] making obvious that we create a regex predicate.
225
225
* @see Criteria.regex
226
226
*/
227
- infix fun KProperty <* >.regex (re : BsonRegularExpression ) = addOperation { regex(re) }
227
+ infix fun KProperty<String? >.regex (re : BsonRegularExpression ) = addOperation { regex(re) }
228
228
229
229
/* *
230
230
* Creates a geospatial criterion using a $geoWithin $centerSphere operation. This is only available for
@@ -311,7 +311,7 @@ class TypedCriteriaBuilder {
311
311
* Creates a criterion using the given object as a pattern.
312
312
* @see Criteria.alike
313
313
*/
314
- infix fun KProperty < * >. alike (sample : Example <* >) = addOperation { alike(sample) }
314
+ fun alike (sample : Example <* >) = addOperation { alike(sample) }
315
315
316
316
/* *
317
317
* Creates a criterion (`$jsonSchema`) matching documents against a given structure defined by the
@@ -343,6 +343,10 @@ class TypedCriteriaBuilder {
343
343
criteria = criteria.and (nestedFieldName(this )).operation()
344
344
}
345
345
346
+ private fun addOperation (operation : Criteria .() -> Criteria ) {
347
+ criteria = criteria.operation()
348
+ }
349
+
346
350
/* *
347
351
* Creates an 'or' criteria using the $or operator for all of the provided criteria
348
352
*
0 commit comments