Skip to content

Can we remove the "deprecated" status from human_readable_serialization in CollectionOptions? #1014

@whfuyn

Description

@whfuyn

That's exactly the feature I want, for a better debugging experience and to ease the burden of users having to encode things themselves. (These reasons might not be enough to justify it, though.)

Performance is not a major concern in my case.

Without this option, I'll have to manually implement the serialization for some structs deep in a dependence. :(

Is it possible to remove this "deprecated" status? If not, is there a plan to remove this field once the bug is fixed?

/// These are the valid options for creating a [`Collection`](crate::Collection) with
/// [`Database::collection_with_options`](crate::Database::collection_with_options).
#[derive(Clone, Debug, Default, Deserialize, TypedBuilder)]
#[builder(field_defaults(default, setter(into)))]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct CollectionOptions {
    // ...

    /// Sets the [`bson::SerializerOptions::human_readable`] option for the [`Bson`]
    /// serializer. The default value is `false`.
    /// Note: Specifying `true` for this value will decrease the performance of insert
    /// operations.
    #[deprecated = "This is a workaround for a potential bug related to RUST-1687, and should \
                    not be used in new code."]
    pub human_readable_serialization: Option<bool>,
}

Metadata

Metadata

Labels

tracked-in-jiraTicket filed in Mongo's Jira system

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions