I have a field in my document that is stored as a Timestamp like so
"created_at": admin.firestore.FieldValue.serverTimestamp(),
What I want to do is find all documents using the admin lib in Cloud Functions, that have this field over 24 hours old
const tsToMillis = admin.firestore.Timestamp.now().toMillis();
const results = await files.where("created_at", ">", tsToMillis - (24 * 60 * 60 * 1000)).get();
I have tried the above, however I'm not sure how to get the value to compare it, or is there a way to do this directly with the Timestamp in FS without converting it?