Skip to content

Array of Dates are saved as array of Strings #3591

@hipwelljo

Description

@hipwelljo

Issue Description

This is a regression introduced in version 2.3.3, it seems most likely due to #3389. If you define an Array column and you save an array of Date objects to it (see Swift code below), it will actually save it as an array of Strings. With version 2.3.2, they were properly saved as Date objects.

Steps to reproduce

  1. Add an Array column to your user schema
  2. Save an array of dates to that field - example in Swift:
guard let user = PFUser.current() else { return }
user["dates"] = [Date()]
user.saveEventually()

Expected Results

The dates field should contain a single Date object

Actual Outcome

The dates field contains a single String object

Environment Setup

  • Server

    • parse-server version: Any version after 2.3.2, specifically tested 2.3.6
    • Operating System: not sure
    • Hardware: not sure
    • Localhost or remote server? Remote on Heroku
  • Database

    • MongoDB version: 3.2.11 (MMAPv1)
    • Storage engine: not sure
    • Hardware: not sure
    • Localhost or remote server? Remote on mLab

Logs/Trace

Not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions