diff --git a/rs/packages/db/src/models/media_session/mod.rs b/rs/packages/db/src/models/media_session/mod.rs index 6b6199fe..6b022014 100644 --- a/rs/packages/db/src/models/media_session/mod.rs +++ b/rs/packages/db/src/models/media_session/mod.rs @@ -1,5 +1,10 @@ use crate::Model; -use mongodb::{bson::doc, options::FindOneOptions, results::UpdateResult, IndexModel}; +use mongodb::{ + bson::{doc, SerializerOptions}, + options::FindOneOptions, + results::UpdateResult, + IndexModel, +}; use serde::{Deserialize, Serialize}; use serde_util::DateTime; use ts_rs::TS; @@ -83,7 +88,11 @@ pub struct MediaSessionNowPlaying { impl From for mongodb::bson::Bson { fn from(value: MediaSessionNowPlaying) -> Self { - mongodb::bson::to_bson(&value).expect("error convering MediaSessionNowPlaying to Bson") + mongodb::bson::to_bson_with_options( + &value, + SerializerOptions::builder().human_readable(false).build(), + ) + .expect("error convering MediaSessionNowPlaying to Bson") } } diff --git a/rs/packages/db/src/models/station/mod.rs b/rs/packages/db/src/models/station/mod.rs index c70d871c..d539425d 100644 --- a/rs/packages/db/src/models/station/mod.rs +++ b/rs/packages/db/src/models/station/mod.rs @@ -6,7 +6,7 @@ use constants::validate::*; use drop_tracer::Token; use geoip::CountryCode; use lang::LangCode; -use mongodb::bson::{doc, Bson}; +use mongodb::bson::{doc, Bson, SerializerOptions}; use mongodb::options::{FindOneAndUpdateOptions, ReturnDocument}; use mongodb::{ClientSession, IndexModel}; use serde::{Deserialize, Serialize}; @@ -332,7 +332,11 @@ pub struct OwnerDeploymentInfo { impl From for Bson { fn from(info: OwnerDeploymentInfo) -> Bson { - mongodb::bson::to_bson(&info).unwrap() + mongodb::bson::to_bson_with_options( + &info, + SerializerOptions::builder().human_readable(false).build(), + ) + .unwrap() } } diff --git a/rs/packages/db/src/models/station_picture_variant/mod.rs b/rs/packages/db/src/models/station_picture_variant/mod.rs index 526f9361..83701cfb 100644 --- a/rs/packages/db/src/models/station_picture_variant/mod.rs +++ b/rs/packages/db/src/models/station_picture_variant/mod.rs @@ -1,6 +1,6 @@ use crate::{storage_db, Model}; use bytes::Bytes; -use mongodb::bson::doc; +use mongodb::bson::{doc, SerializerOptions}; use mongodb::options::IndexOptions; use mongodb::IndexModel; use serde::{Deserialize, Serialize}; @@ -58,6 +58,10 @@ pub enum StationPictureVariantFormat { impl From for mongodb::bson::Bson { fn from(value: StationPictureVariantFormat) -> Self { - mongodb::bson::to_bson(&value).unwrap() + mongodb::bson::to_bson_with_options( + &value, + SerializerOptions::builder().human_readable(false).build(), + ) + .unwrap() } }