skip to Main Content

I am not sure if I am doing something wrong or cosmos db has a bug in the UI.

We are storing a LONG (INT64) value in the database, it seems it is stored correctly, but it is shown wrong in the UI.
enter image description here

As you can see, I have a complete different value in the WHERE condition as in the response.

2

Answers


  1. It’s not a bug, The numeric value here is a 64-bit double, not an integer, which means it may lose precision. These two values share the same floating-point representation, leading to their comparison as equal. This occurs when values exceed the 64-bit integer limit.

    Login or Signup to reply.
  2. This is an issue on the Azure Portal only, the reason is that Javascript in the browser has precision limits and it’s officially documented at: https://learn.microsoft.com/azure/cosmos-db/faq#why-are-long-floating-point-values-in-a-document-rounded-when-viewed-from-data-explorer-in-the-portal-

    This is limitation of JavaScript. JavaScript uses double-precision floating-point format numbers as specified in IEEE 754 and it can safely hold numbers between -(253 – 1) and 253-1 (i.e., 9007199254740991) only.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search