Skip to content

Error importing data from export: 'objectId is an invalid field name.' #2184

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

Closed
doender opened this issue Jul 1, 2016 · 4 comments
Closed

Comments

@doender
Copy link

doender commented Jul 1, 2016

I want to import existing data into a new parse-server instance (without using the migration tool).
However, when creating an object with a sett objectId using the rest api I get:

{u'code': 105, u'error': u'objectId is an invalid field name.'}

Also, if I delete the object id, the updatedAt and createdAt dates are not respected (they are set to the current date). Is there another way to import existing data?

@hramos
Copy link
Contributor

hramos commented Jul 1, 2016

The objectId field cannot be set using the REST API. Have you tried importing the data into mongo directly?

@doender
Copy link
Author

doender commented Jul 1, 2016

I have now exported and imported from mongodb using mongoexport and mongoimport.
This seems to have worked. Is this the recommended approach?

@hramos
Copy link
Contributor

hramos commented Jul 1, 2016

For the time being, yes. Parse.com's Dashboard allowed JSON to be imported via the dashboard since you did not have direct access to the database. For Parse Server, you can import data directly into the mongo database, no need to go through the server.

@doender
Copy link
Author

doender commented Jul 1, 2016

Thanks, seems to be solved this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants