-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to set createdAt
and updatedAt
during data import(s)
#7447
Comments
Thanks for suggesting. This seems to be a valid use case. In general, even though the
If being used as a data field, it should be possible to set it on object creation, but also to edit when updating an existing object. There should be no substantial implication in the server or SDKs because being date fields, it would be unreliable to draw any conclusion about the object state. If there was indeed object state logic depending on these fields, removing these dependencies would be an improvement as a side effect of this PR. Do you want to look into this and open a PR? (Note: I removed the link to your product as advertising; it is not relevant to this issue.) |
I'll try to have a look, but I want to complete.the others PRs before. It might take some time but I'll try a few things out. |
Currently, the Swift:
The potential of this PR seems like there will need to more items resolved before it can be implemented. Currently, the Server can accept ParseObjects with/without custom objectId’s from clients when If this does end up being implemented, I recommend it has an on/off feature and it should be off by default. |
It only determines whether createdAt exists, not its value. If we establish the rule that a saved object always must have a createdAt / updatedAt, that shouldn't interfere (much). The approaches you referenced seem a bit flawed anyway. Various ways to determine whether an object has been saved or not, depending on whether custom obj id is set, looks too complex with the potential for ambiguity, as we see now with this proposed change. |
@cbaker6 my idea for a first step would be ONLY for freshly created objects. IFF you save a new object, and the object contains ** Actually, I really only care about So I think this PR scope will be limited to :
It will also reduce the required changes and avoid nasty side effects. Would that solve the problem for the API clients ? |
All of the SDKs use |
I’m not sure... I made my comment just to mention that |
This feature would be appreciated. Currently I connect to mongodb manually from my seed scripts to populate createdAt and updatedAt. curious to know, would this be a bad practice? Meaning is there any side effect in terms of how parse stores these fields internally? |
createdAt
and updatedAt
during data import(s)createdAt
and updatedAt
during data import(s)
🎉 This change has been released in version 6.4.0-alpha.4 |
🎉 This change has been released in version 6.5.0-beta.1 |
Amaizing work guys ! 🚀 |
🎉 This change has been released in version 6.5.0-alpha.1 |
🎉 This change has been released in version 6.5.0 |
🎉 This change has been released in version 7.0.0 |
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
andupdatedAt
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:createdAt
orupdatedAt
fields exists and have a valid value, use theses values. Leave as-is when updating an objectflag
/option
inParse.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 theparse object creation
andevent creation
Alternatives / Workarounds
createdAt
/updatedAt
values into new fieldsuserCreatedAt
anduserUpdatedAt
createdAt = userCreatedAt
3rd Party References
The text was updated successfully, but these errors were encountered: