Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

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
share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
    
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 – vxb8874 Nov 14 '14 at 12:41
    
Parse.com upgraded its import system to support the insertion of new rows. Any duplicates will be skipped. – Carl Jul 16 '15 at 9:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.