Auditing Fields - Record Created Date, created user, updated date, updated user

140 views
Skip to first unread message

Kart

unread,
Aug 7, 2019, 11:03:19 AM8/7/19
to Firebase Google Group
Hi All,

I am from RDBMS background. In RDBMS we usually add auditing fields to make sure who changed the record and when etc. 

Do we have any in-built change log available in firestore or I need add fields in document and maintain that accordingly. Could anyone please let me know. 


Sam Stern

unread,
Aug 7, 2019, 12:05:31 PM8/7/19
to Firebase Google Group
Hi Kart,

There is no built-in change log to Firestore.  If you want to keep track of this information you should add your own timestamp fields to each document.  To help you with this Firestore has a concept of a "server timestamp"
https://cloud.google.com/firestore/docs/manage-data/add-data#server_timestamp

You set a special value in the field and the server will update that field with the time it receives the document.  That way you don't have to worry about the clocks of your users devices not agreeing.

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/7a727a20-268d-48ad-b2b3-c1c75c6f8e41%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages