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

Epoch values (10byte number) from the sample data is being shown in the output in scientific format. #173

Open
soorajsprakash opened this issue Apr 2, 2024 · 2 comments

Comments

@soorajsprakash
Copy link

Hi, So, have been using the playground recently (and its fun, thanks),
And while I was testing out some aggregation pipelines, i found out that even after a mere $match stage, epoch data (10 byte long number) was being shown in an exponential/scientific format in the output.

It will most likely a formatter issue.

Ex: 1658318035 -> 1.658318035e+09

Sample data:

[
  {
    "collection": "collection",
    "count": 100,
    "createdAt": 1658318035
  }
]

Query:

db.collection.aggregate([
  {
    "$match": {
      count: 100
    }
  }
])

Output:

[
  {
    "_id": ObjectId("5a934e000102030405000000"),
    "collection": "collection",
    "count": 100,
    "createdAt": 1.658318035e+09
  }
]
@feliixx
Copy link
Owner

feliixx commented Apr 3, 2024

Hi @soorajsprakash, thanks for reporting this !

I agree that it's weird to have this field formatted differently, We could probably tweak the driver to prevent it from formatting these numbers. I'll try to give it a shot next week

@soorajsprakash
Copy link
Author

Thanks

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

2 participants