Open
Conversation
yoiang
requested changes
Jul 19, 2018
|
|
||
| documentRequestLimit: number; | ||
|
|
||
| fileWrite: void; |
Member
There was a problem hiding this comment.
Hmm, I'm trying to think of what would be a more apt member name, technically this isn't a fileWrite function anymore, it's an any-way-we-want-to-handle-the-contents function now.
| exclude: Array<string>, | ||
| excludePatterns: Array<RegExp> | ||
| excludePatterns: Array<RegExp>, | ||
| fileWrite: void |
Member
|
@KRVJKvothe thanks so much for the PR! The idea is great, something that should have been in a long time ago. I've added a few review requests but otherwise it looks great! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.