1

I need to upload cvs/json file directly to parse table to populate data (bulk insert) from client side website

As per parse documentation, it seems below curl command can upload a file but it's not clear how to point to a specific parse table.

Is there an equivalent code snippet to call below curl command from java script as i need to make this call from client side website to accept cvs/json file as input and load data

curl -X POST \
  -H "X-Parse-Application-Id: X4ja65SBrNUK88zGBAQgIuR9FWdnvk1QZssZehzu" \
  -H "X-Parse-REST-API-Key: EQVLrkxQRsbiLubm6pY3VVLZkm9a4V0n63cPWrqA" \
  -H "Content-Type: text/plain" \
  -d 'Hello, World!' \
  https://api.parse.com/1/files/hello.txt

1 Answer 1

2

That REST call will upload a file for storage in Parse. It won't let you import it into the database.

Because you want to run this programmatically from another website, you'll have to use the REST APIs. You'll need to run through each object you want to insert, and make a REST API call to insert it in the database. You can save API hits by batching them together, in blocks of up to 50.

There is also a manual solution, which might be simpler if it's a once-off setup of some initial data. You can do this by opening you web browser, log into your Parse.com account, choose the app you want to import data for, click on Core in the header, and then in the Data section on the left, you'll see an "Import" button. You can upload your CSV or JSON file there. NOTE: this is only valid for importing data into a new class - you can't add data to an existing class (bar the User and Installation I think). If you have an empty class, just delete it and use the file import to create it.

Parse do have some documentation on importing data, available at their website.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks a lot for the response - I was aware of functionality to import data from parse but i need to provide ability to import data into existing parse object on client side and unfortunately, it would not be one off event -- running thru each object for every insert would become slow for relatively large file but i will look into that possibility -- thanks again
Parse.com upgraded its import system to support the insertion of new rows. Any duplicates will be skipped.
As of this writing parse.com has removed the import button off their dashboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.