Closed alitecsolucoes closed 3 years ago
You can use:
import Transform from 'firebase-firestore-lite/src/Transform.js'
const ref = db.ref('users/samuel');
await ref.update({
count: new Transform('increment', 1),
last: new Transform('serverTimestamp')
});
as well documented in https://samuelgozi.github.io/firebase-firestore-lite/classes/transform.html
@alijuniorbr Gave the right answer :) Thanks you!
Can I use these features available in the official library:
to increment a value without reading the document and store the server timestamp to the document?
Thank you very much in advance for the excellent work in these libraries!!