kossnocorp / typesaurus

🦕 Type-safe TypeScript-first ODM for Firestore
https://typesaurus.com
412 stars 34 forks source link

How to create a firestore id? #119

Closed mparpaillon closed 1 year ago

mparpaillon commented 1 year ago

Hey there. Thanks for the awesome lib. I've been trying to do something similar before looking for an existing one. Kudos, it looks awesome.

One thing that seems to be missing is a way to generate a Firestore id.

I used to do something like this in frontend

const ref = docRef("yo", "8"); // Path doesn't matter really
return ref.id;

and this in the backend:

return admin.firestore().collection("yo").doc().id;

How could I do something like that with your lib? Thanks!!