Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the fileWrite, you can send any function in the options.
The function must have the fields path and filecontents.
That's to save the file in anywhere you want like the cloud.
For example:
function saveFileS3 (path, content) {
const params = {
Bucket: s3Bucket,
Key: (new Date()).toISOString() + (!path.startsWith('/') && '/' || '0') + path,
ContentType: 'application/json',
Body: content
}
s3.putObject( params, (err, data) => {
if (err) {
console.log(err)
} else {
console.log('Guardado: ' + path)
}
})
}
To save in an AWS S3 Bucket.
so you send the function in the fileWrite in options, like:
firestore({
accountCredentials: {
project_id: CONFIG.GOOGLE_PROJECT_ID,
private_key: CONFIG.GOOGLE_PRIVATE_KEY,
client_email: CONFIG.GOOGLE_CLIENT_EMAIL
},
backupPath: '',
fileWrite: saveFileS3
}).then(......)
Thank's you for the firestore-backup.