Skip to content

SWIFT-1130 Suggestion for change to JSON dates for toRelaxedExtendedJSON() #73

Open
@NotesClef

Description

@NotesClef

I would like to suggest a change to the date format resulting from toRelaxedExtendedJSON() from Date+BSONValue.swift

In the context of relaxed, users being provided JSON find it odd to see dates represented as objects (which is more mongo style than typical JSON users we supply JSON to are accustomed):

"date_valid_from": {
            "$date": "2021-12-26T00:00:00Z"
          }

For relaxed formatting, it would seem preferable to return dates instead as:

"date_valid_from": "2021-12-26T00:00:00Z"

When we wish to return JSON preserving mongo formatting, we still have canonical.

Would this suggestion be agreeable, or is there a reason I'm missing for the dates being formatted this way for relaxed?

Thank you for your consideration.

Metadata

Metadata

Assignees

No one assigned

    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