Skip to content

Commit 4000d3d

Browse files
committed
DATAMONGO-2138 - Bring back chaining
1 parent ad256c6 commit 4000d3d

File tree

4 files changed

+91
-78
lines changed

4 files changed

+91
-78
lines changed

spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/NestedProperty.kt

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,3 +40,15 @@ internal fun nestedFieldName(property: KProperty<*>): String {
4040
else -> property.name
4141
}
4242
}
43+
44+
/**
45+
* Build nested properties.
46+
* Refer to a field in an embedded/nested document.
47+
*
48+
* For example, referring to the field "book.author":
49+
* ```
50+
* Book::author / Author::name isEqualTo "Herman Melville"
51+
* ```
52+
*/
53+
operator fun <T, U> KProperty<T>.div(other: KProperty1<T, U>) =
54+
NestedProperty(this, other)

0 commit comments

Comments
 (0)