Skip to content

Apps script FirestoreApp when query 'collection1' where 'timestampField' == my_variable_Timestamp  #150

Description

@ab2d3e8

Minimal code to reproduce the problem

const firestore = FirestoreApp.getFirestore(email, key, projectId);
var my_variable_Timestamp = Utilities.formatDate(new Date(), 'GMT -1', 'yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'')
const docsFS = firestore.query("collection1").Where("timestampField", "==",  my_variable_Timestamp  ).Execute();

Expected Behavior

There are no results.

Actual Results

I did not find a way to make the query, try converting the date to a number, for example

var my_variable_Timestamp = Number(new Date().getTime()).toFixed(0);

But without any result.
I expect the library FirestoreApp, It does not contain a property Timestamp like

var my_variable_Timestamp =  firestore.Timestamp.fromDate( new Date() )

Is there a solution to this problem

Library Version:

last Version;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions