19 | event.preventDefault();
20 | db.collection('todos').add({
21 | todo:input,
22 | timestamp: firebase.firestore.FieldValue.serverTimestamp()
23 | });
24 |
25 | setInput("");
Whenever I try to run this code, it shows me type error. So that I cant able to push the data to firebase
For those who are using the Admin SDK with NodeJS:
import { FieldValue } from '@google-cloud/firestore'
const docData = {
userName: 'Lucas'
createdAt: FieldValue.serverTimestamp()
}
You could find all the external API's references here: https://firebase.google.com/docs/reference/admin/node/firebase-admin.firestore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With