@@ -15,7 +15,7 @@ use serde::{
15
15
16
16
use self :: options:: * ;
17
17
use crate :: {
18
- bson:: { doc, to_document , Bson , Document } ,
18
+ bson:: { doc, to_document_with_options , Bson , Document , SerializerOptions } ,
19
19
bson_util,
20
20
change_stream:: {
21
21
event:: ChangeStreamEvent ,
@@ -1119,7 +1119,10 @@ where
1119
1119
options : impl Into < Option < FindOneAndReplaceOptions > > ,
1120
1120
session : impl Into < Option < & mut ClientSession > > ,
1121
1121
) -> Result < Option < T > > {
1122
- let replacement = to_document ( replacement. borrow ( ) ) ?;
1122
+ let replacement = to_document_with_options (
1123
+ replacement. borrow ( ) ,
1124
+ SerializerOptions :: builder ( ) . human_readable ( false ) . build ( ) ,
1125
+ ) ?;
1123
1126
1124
1127
let session = session. into ( ) ;
1125
1128
@@ -1379,7 +1382,10 @@ where
1379
1382
options : impl Into < Option < ReplaceOptions > > ,
1380
1383
session : impl Into < Option < & mut ClientSession > > ,
1381
1384
) -> Result < UpdateResult > {
1382
- let replacement = to_document ( replacement. borrow ( ) ) ?;
1385
+ let replacement = to_document_with_options (
1386
+ replacement. borrow ( ) ,
1387
+ SerializerOptions :: builder ( ) . human_readable ( false ) . build ( ) ,
1388
+ ) ?;
1383
1389
1384
1390
bson_util:: replacement_document_check ( & replacement) ?;
1385
1391
0 commit comments