Skip to content

Allow to set createdAt and updatedAt during data import(s) #7447

Closed
@sadortun

Description

@sadortun

New Feature / Enhancement Checklist

Current Limitation

I'm sure it was discussed somewhere, but i could not find anything.

Currently when you import data from a different source, there is no way to set createdAt and updatedAt fields to the existing value of the imported source.

Feature / Enhancement Description

I'm not sure if theses fields have an impact of core parse functionalities, but here is a few suggestions:

  • When creating a new object, If createdAt or updatedAt fields exists and have a valid value, use theses values. Leave as-is when updating an object
  • Add a flag/option in Parse.Object.save() to indicate you want to preserve theses fields.

Example Use Case

In our app we allow users to import transactions from various sources. Currently we need to save the transaction date into a separate field since createdAt is not usable.

In a few other projects, we are syncing data from a 3rd party into Parse DB, and since we cannot use createdAt to store the event creation date, we need to store this in a separate field. This cause confusion, since its not clear why you have two fields to store the parse object creation and event creation

Alternatives / Workarounds

  1. Add user's createdAt/updatedAt values into new fields userCreatedAt and userUpdatedAt
  2. Add all objects
  3. Use MongoDB adapter to update createdAt = userCreatedAt

3rd Party References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions