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
Some key new features of the Java driver and Java Async driver include:
13
+
14
+
### Support for Decimal128 Format
15
+
16
+
```java
17
+
importorg.bson.types.Decimal128;
18
+
```
19
+
20
+
The `Decimal128` format supports numbers with up to 34 decimal digits
21
+
(i.e. significant digits) and an exponent range of −6143 to +6144.
22
+
23
+
To create a `Decimal128` number, you can use
24
+
25
+
-[`Decimal128.parse()`] ({{<apiref "org/bson/types/Decimal128.html">}}) with a string:
26
+
27
+
```java
28
+
Decimal128.parse("9.9900");
29
+
```
30
+
31
+
-[`new Decimal128()`] ({{<apiref "org/bson/types/Decimal128.html">}}) with a long:
32
+
33
+
34
+
```java
35
+
new Decimal128(10L);
36
+
```
37
+
38
+
-[`new Decimal128()`] ({{<apiref "org/bson/types/Decimal128.html">}}) with a `java.math.BigDecimal`:
39
+
40
+
```java
41
+
new Decimal128(new BigDecimal("4.350000"));
42
+
```
43
+
44
+
### Support for Collation
45
+
46
+
```java
47
+
importcom.mongodb.client.model.Collation;
48
+
```
49
+
50
+
[Collation]({{<docsref "release-notes/3.3-dev-series-collation/">}}) allows users to specify language-specific rules for string
51
+
comparison.
52
+
Use the [`Collation.builder()`] ({{<apiref "com/mongodb/client/model/Collation.html">}})
53
+
to create the `Collation` object. For example, the following example creates a `Collation` object with Primary level of comparison and [locale]({{<docsref "release-notes/3.3-dev-series-collation/#supported-languages-and-locales">}}) ``fr``.
You can specify collation at the collection level, at an index level, or at a collation-supported operation level:
60
+
61
+
#### Collection Level
62
+
63
+
To specify collation at the collection level, pass a `Collation` object as an option to the `createCollection()` method. To specify options to the `createCollection` method, use the [`CreateCollectionOptions`]({{<apiref "com/mongodb/client/model/CreateCollectionOptions.html">}}) class.
To specify collation for an index, pass a `Collation` object as an option to the `createIndex()` method. To specify index options, use the [IndexOptions]({{<apiref "com/mongodb/client/model/IndexOptions.html">}}) class.
0 commit comments