You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/geo/GeoJsonSerializersUnitTests.java
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/mongodb.adoc
+6-2
Original file line number
Diff line number
Diff line change
@@ -1446,6 +1446,7 @@ The geo-near operations return a `GeoResults` wrapper object that encapsulates `
1446
1446
1447
1447
MongoDB supports https://geojson.org/[GeoJSON] and simple (legacy) coordinate pairs for geospatial data. Those formats can both be used for storing as well as querying data. See the https://docs.mongodb.org/manual/core/2dsphere/#geospatial-indexes-store-geojson/[MongoDB manual on GeoJSON support] to learn about requirements and restrictions.
1448
1448
1449
+
[[mongo.geo-json.domain.classes]]
1449
1450
==== GeoJSON Types in Domain Classes
1450
1451
1451
1452
Usage of https://geojson.org/[GeoJSON] types in domain classes is straightforward. The `org.springframework.data.mongodb.core.geo` package contains types such as `GeoJsonPoint`, `GeoJsonPolygon`, and others. These types are extend the existing `org.springframework.data.geo` types. The following example uses a `GeoJsonPoint`:
@@ -1469,6 +1470,7 @@ public class Store {
1469
1470
----
1470
1471
====
1471
1472
1473
+
[[mongo.geo-json.query-methods]]
1472
1474
==== GeoJSON Types in Repository Query Methods
1473
1475
1474
1476
Using GeoJSON types as repository query parameters forces usage of the `$geometry` operator when creating the query, as the following example shows:
Then MongoDB `$geoNear` operator allows usage of a GeoJSON Point or legacy coordinate pairs.
@@ -1700,9 +1703,10 @@ Returning the 3 Documents just like the GeoJSON variant:
1700
1703
<4> Distance from center point in _Kilometers_ - take it times 1000 to match _Meters_ of the GeoJSON variant.
1701
1704
====
1702
1705
1706
+
[[mongo.geo-json.jackson-modules]]
1703
1707
==== GeoJSON Jackson Modules
1704
1708
1705
-
By using the <<core.web>>, Spring Data adds additional Jackson ``Modules``s to the `ObjectMapper` for de-/serializing common types used by the Spring Data domain.
1709
+
By using the <<core.web>>, Spring Data registers additional Jackson ``Modules``s to the `ObjectMapper` for de-/serializing common Spring Data domain types.
1706
1710
Please refer to the <<core.web.basic.jackson-mappers>> section to learn more about the infrastructure setup of this feature.
1707
1711
1708
1712
The MongoDB module additionally registers ``JsonDeserializer``s for the following GeoJSON types via its `GeoJsonConfiguration` exposing the `GeoJsonModule`.
@@ -1734,7 +1738,7 @@ class GeoJsonConfiguration implements SpringDataJacksonModules {
1734
1738
1735
1739
[WARNING]
1736
1740
====
1737
-
The next major version (`4.0`) will by default register both, ``JsonDeserializer``s and ``JsonSerializer``s for GeoJSON types.
1741
+
The next major version (`4.0`) will register both, ``JsonDeserializer``s and ``JsonSerializer``s for GeoJSON types by default.
0 commit comments