mongoplayground icon indicating copy to clipboard operation
mongoplayground copied to clipboard

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

Open soorajsprakash opened this issue 10 months ago • 2 comments

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
  }
]

soorajsprakash avatar Apr 02 '24 05:04 soorajsprakash

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

feliixx avatar Apr 03 '24 20:04 feliixx

Thanks

soorajsprakash avatar Apr 05 '24 09:04 soorajsprakash