Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for nested geo #47 #52

Merged
merged 6 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ typings/
.env

# test folder
test/serviceAccountKey.json
test/serviceAccountKey.json
.idea
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

---

## [0.6.0] - 2020-05-26

#### - :nail_care: [Polish]

- Updated new pacakges
- Added support for nested geo #47

## [0.5.0] - 2020-04-05

#### - :nail_care: [Polish]
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ firebase firestore:delete [options] <<path>>

#### For local JSON

Usually the date, location & reference is not converted correctly when you backup the Firestore database. In order to import correctly, you have to pass to parameters for the options:
Usually the date, location & reference are not converted correctly when you backup the Firestore database. In order to import correctly, you have to pass to parameters for the options:

```javascript
// Import options
const options = {
dates: ['date1', 'date1.date2', 'date1.date2.date3'],
geos: ['location', 'locations'],
refs: ['refKey'],
nested: true // look up the data keys also in nested maps
};
```

Expand Down
20 changes: 20 additions & 0 deletions dist/helper.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export interface IImportOptions {
dates?: string[];
geos?: string[];
refs?: string[];
}
/**
* Convert time array in a Date object
* @param firebaseTimestamp
*/
export declare const makeTime: (firebaseTimestamp: {
_seconds: number;
_nanoseconds: number;
}) => Date;
/**
* Traverse given data, until there is no sub node anymore
* Executes the callback function for every sub node found
* @param data
* @param callback
*/
export declare const traverseObjects: (data: any, callback: Function) => void;
40 changes: 40 additions & 0 deletions dist/helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/helper.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions dist/import.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export interface IImportOptions {
dates?: string[];
geos?: string[];
refs?: string[];
}
import { IImportOptions } from './helper';
/**
* Restore data to firestore
*
Expand Down
20 changes: 12 additions & 8 deletions dist/import.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading