We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
He there!
We need some workaround for documents that created without id inside js object - see example.
id
import * as admin from 'firebase-admin' @Collection() class Band { id: string; name: string; } async function createBand(band: Band): string { const doc = await admin.firestore().collection('bands').add(band); return doc.id; } async function getById(id: string): Promise<Band> { const doc = await admin.firestore().collection('bands').doc(id); return {id: doc.id, ...doc.data()}; } // Assume, that we used firestore native sdk to create doc: const band = new Band(); band.name = 'Nirvana'; const bandId = await createBand(band); // then we decided to use fireorm const bandFromFirestore = await getRepository(Band).findById(bandId); expect(bandFromFirestore).to.be.instanceof(Band); // true expect(bandFromFirestore.id).not.to.be.undefined; // error!
I've created pull request (/w tests) that resolved this - #120
The text was updated successfully, but these errors were encountered:
fix: fetching entity w/o id within firestore doc
fed065a
Refs wovalle#119
lgtm
Sorry, something went wrong.
Closed in #124
No branches or pull requests
He there!
We need some workaround for documents that created without
id
inside js object - see example.I've created pull request (/w tests) that resolved this - #120
The text was updated successfully, but these errors were encountered: