swipe
swipe9mo ago

I am creating a new document in Firebase

I am creating a new document in Firebase. What is the best way to insert a created_at timestamp (DateTime.now().microsecondsSinceEpoch) using the Firestore Create Document node?
1 Reply
Gaurav Chadha
Gaurav Chadha9mo ago
Hi @swipe, You can use the JS methods when sending data. Example: This will insert in Firestore TimeStamp format.
{
"username": "Finn Cole",
"usage": "AI",
"createdAt": new Date()
}
{
"username": "Finn Cole",
"usage": "AI",
"createdAt": new Date()
}
Also, if you want custom format, you can JavaScript methods directly in the editor.