Hello,
We’ve been using cosmos for a few years now and just recently discovered some odd behavior. We are using the .net SDK but occasionally use the data explorer to manually view/update data for production support purposes.
To illustrate this odd behavior, we’ll use the following .net class
public class Foo
{
public int MyInt { get; set; }
public double MyDouble { get; set; }
public decimal MyDecimal { get; set; }
}
Now, in .net if I set them all to 0, and stuff them into my cosmos container, like so:
var foo = new Foo
{
MyInt = 0,
MyDouble = 0,
MyDecimal = 0
};
_container.CreateItemAsync(foo)
When we retrieve the item from cosmos .net client MyDouble and MyDecimal return as 0.0.
When we retrieve the item using an HTTP request in postman, MyDouble and MyDecimal return as 0.0.
The kicker is, when we retrieve the item using the data explorer, MyDouble and MyDecimal return as 0.
Additionally, when we update the item using data explorer, the values for MyDouble and MyDecimal are saved as 0 and returned to .net client as C as well as the HTTP/REST API in postman.
My understanding is the .net SDK is simply making an HTTP POST sending the serialized json to cosmos. I have inspected the request message being sent by the .net sdk, and confirm it is sending 0, not 0.0.
It seems cosmos under the hood somewhere is persisting the data as 0.0, vs 0, but the data explorer is taking the data as it was typed in by the user.
Is there any insight you can provided into why we are seeing this behavior?