Skip to content

Commit

Permalink
docs(README): update Data Structure section
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSolati committed Jun 14, 2020
1 parent 5a2e669 commit a3546a2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,20 @@ Internally GeoFirestore creates multiple geohashes around a requested area. It t

### Data Structure

GeoFirestore is based off of the `geofire` JavaScript library. Documents generated and stored in your Firestore collection by GeoFirestore are typed/structured as:
Documents generated and stored in your Firestore collection by GeoFirestore are typed/structured as:

```TypeScript
interface GeoDocument {
g: string;
l: GeoPoint;
d: DocumentData;
g: {
geohash: string;
geopoint: GeoPoint;
};
[field: string]: any;
}
```

- `g` is the geohash generated by the library, and is required in order to make the geoqery.
- `l` is the GeoPoint used to generate the `g` field.
- `d` is a sub-object which is where your data is stored.
- `g.geohash` is the geohash generated by the library, and is required in order to make the geoqery.
- `g.geopoint` is the GeoPoint used to generate the `g.geohash` field.

Data must be structured this was in order to work, and is why you should use the GeoFirestore library to insert data in order to be able to query it.

Expand Down

0 comments on commit a3546a2

Please sign in to comment.