Skip to content

Commit 7a6f392

Browse files
Some documentation
1 parent 690f09a commit 7a6f392

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/antora/modules/ROOT/pages/mongodb/mapping/custom-conversions.adoc

+8
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,11 @@ class MyMongoConfiguration extends AbstractMongoClientConfiguration {
103103
}
104104
}
105105
----
106+
107+
[[mongo.numeric-conversion]]
108+
== Big Number Format
109+
110+
MongoDB in its early days did not have support for large numeric values such as `BigDecimal`.
111+
In order to persist values those types got converted into their `String` representation.
112+
Nowadays `org.bson.types.Decimal128` offers a native solution to storing big numbers.
113+
Next to influencing the to be stored numeric representation via the `@Field` annotation you can configure `MongoCustomConversions` to use `Decimal128` instead of `String` via the `MongoConverterConfigurationAdapter#numericFormat(...)` or set the `mongo.numeric.format=decimal128` property.

0 commit comments

Comments
 (0)