0

In Mongodb I have a field representing a timestamp (milliseconds since 1970), but it is in fact a long saved from Python.

I now want to get all entries done after a certain time. I cannot find a way though how to get the current time as a timestamp in a mongo shell style. One thing I've tried e.g. was:

use binfut;
db.getCollection("liq").aggregate(
    [
        { 
            "$match" : { 
                "coin" : "BTC-USDT", 
                "side" : "SELL", 
                "timestamp" : { 
                    "$lte" : ISODate("2018-10-02T01:11:18.965+0000")
                }
            }
        }
    ], 
    { 
        "allowDiskUse" : false
    }
);

But I also used new Date(), etc.

Is there a way to get this done?

MPL
  • 384
  • 1
  • 4
  • 20

1 Answers1

0

See How do you get a timestamp in JavaScript?.

> +ISODate("2018-10-02T01:11:18.965+0000")
1538442678965
D. SM
  • 13,584
  • 3
  • 12
  • 21