I have been experimenting with creating data using firestore in the following manner:
createData({state}) {
return db.collection('items').add({
title: state.title,
ingredients: state.ingredients,
createdAt: new Date()
})
.then( ref => {
console.log(ref.id)
});
}
Is there a way to retrieve the values of items that were recently created? The result should include ref.id, which represents the id of the document.