New to node.js - need bootstrap to downloadfiles from Kinvey
started a topic
over 6 years ago
I have an app (MotorCardiogram) that is creating data and uploading it to Kinvey. Now I want to download it to my machine and process it. In looking at the toolsets available for kinvey, node.js looks like it will fit the bill (intermediate location - on my laptop or linux based computer, small, easy to run). What I want to do is periodically pull all of the files loaded onto the kinvey servers to my machine, and then delete them from the server after I pull them down.
I would like to use implicit users for the time being, but even if I need to create a user on the console, and then use that user in my script, I'm fine with that.
Soren - MotorCardiogram.
about 6 years ago
The "breadcrumbs" are pretty complete. For node.js you'll need to do something like this:
console.log('ERROR: User not found: ' + e.description);
You need to download every file by file id. The download happens in two steps, 1. it gets file meta data from kinvey then 2. it downloads the file from google. Sometimes, kinvey will have meta data on a file but no file. The node library won't really throw the right error in this case. For what you want to do, I'd use the REST api (and probably not node if you're new to it.) You download files in two steps explicitly, and you can just collect all the meta data in one go and simply loop through and grab all the files. Also, if you use master secret you won't need to create any users to download the files (I think you might need to create one to delete them.)