Your Majesty
Your Majesty7mo ago

how to save Current timestamp in firebase create document node

Sorry if this is a dumb question but how do you save the current timestamp to a firebase document with a data type as “timestamp” Eg. { “createdAt”: “currentTimestamp” }
Solution:
Hi @Your Majesty, you just require to use new Date() type of the editor set to Javascript.
Jump to solution
8 Replies
Solution
Gaurav Chadha
Gaurav Chadha7mo ago
Hi @Your Majesty, you just require to use new Date() type of the editor set to Javascript.
Your Majesty
Your MajestyOP7mo ago
Wow thanks a lot!! It worked! Is there a place to find these simple code snippets to use in buildship for we the non coders? I tried using chatgpt but it kept giving me so many firebase.firebaseserver….etc codes. Maybe if you guys(buildship) could recommend, or put up a blog post for these simple code snippets, it would be great. Parsing dates, formatting dates, functions…etc
Gaurav Chadha
Gaurav Chadha7mo ago
You can refer to this for all the basic JS operations guide - https://www.w3schools.com/js/default.asp.
Your Majesty
Your MajestyOP7mo ago
Thanks man!! You’re a lifesaver 👌🏾💯
robot007
robot0075mo ago
Hello @Your Majesty Have you found the solution. It seems BuildShip does not have this feature. It does not support admin package in the expression box, although I imported the admin package. So, I cannot use timestamp in express. Do you have a solution?
No description
No description
AI Support
AI Support5mo ago
It appears that you are encountering an issue with using the admin package in the expression box within BuildShip. This specific functionality may not be supported directly. For further assistance, I recommend submitting your query via the in-app support button in BuildShip. The support team will be able to provide more detailed guidance and potential workarounds for your issue.
Luis
Luis5mo ago
Hi @robot007, if you're looking to store a compatible firebase.firestore.Timestamp then you can have a utility node generate the timestamp for you then reference that in your Create Document node. Here's an example: https://buildship.app/remix/d0a8145b-fe9b-4794-8ba6-618f968b4376
BuildShip - Visual backend workflow builder
Visually build workflows and powerful backend logic for your apps. Powered by AI, connect to anything with or without code.
robot007
robot0075mo ago
Thanks @Luis

Did you find this page helpful?