MichaelSolati / geofirestore-js

Location-based querying and filtering using Firebase Firestore.
https://geofirestore.com
MIT License
505 stars 58 forks source link

Custom ID in add method #93

Closed sedestrian closed 5 years ago

sedestrian commented 5 years ago

Hi, reading the documentation it looks like the only way to add a document to a collection with a custom "coordinates" key is the GeoCollectionReference.add() method, but in my application i need to set a custom document id, and the add() method doesn't provide the option of a custom id. Now if i use a GeoDocumentReference and use the set() method i lose the ability to set a custom "coordinates" key. It would be pretty useful to add an option to set a custom id in the add() method :)

MichaelSolati commented 5 years ago

The set document method has a second argument of a setOptions where you can declare your custom key => https://geofirestore.com/interfaces/_geofirestoretypes_.geofirestoretypes.setoptions.html