IjzerenHein / firestorter

Use Google Firestore in React with zero effort, using MobX 🤘
http://firestorter.com
MIT License
378 stars 50 forks source link

Custom document ID's #6

Closed cworf closed 6 years ago

cworf commented 6 years ago

Hey, A feature I used in a recent angular project while using the angularFire library was the ability to give a document a custom id instead of using the default format. That would be a really useful feature for this. Correct me if I somehow missed it in the docs. Thanks! Great work!

IjzerenHein commented 6 years ago

Hi, you can do this already. Please check: https://github.com/IjzerenHein/firestorter/blob/master/docs/AddUpdateDelete.md

Alternatively, you can use the Document interface to create documents with custom IDs:

const todo = new Document('todos/mydoc');

// Use .set to create the document in the back-end
todo.set({
    finished: false,
    text: 'this is awesome'
});
cworf commented 6 years ago

ah jeez sorry about that. Thats great thank you!