Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Series timestamp format #30

Open
driedger opened this issue Feb 6, 2024 · 2 comments
Open

Time Series timestamp format #30

driedger opened this issue Feb 6, 2024 · 2 comments

Comments

@driedger
Copy link

driedger commented Feb 6, 2024

Hello, I have a large amount of legacy data in mongodb, where the original author chose to store some timestamps as a shortened integer value instead of a native Date datatype. All the values stored are a javascript timestamp, divided by 60,000 so it only represents minutes.

I for the life of me cannot figure out how to use the timestamp format field in the query editor to convert my custom timestamp into a BSON Date. I tried doing the conversion in my projection query, but that also does not return any results.

Could we provide an example of the timestamp formatting options? I attempted to refer to the Go time parse documentation in the tooltip, but cant seem to make it work.

Thanks

@meln5674
Copy link
Owner

The timestamp format uses the Golang format specification, and is linked in the tooltip, but here is the same link for reference: https://pkg.go.dev/time#pkg-constants .

@BbBaboo42
Copy link

have you tried {"$project": {"date": {"$toDate": "$your_date_field"}}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants