<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:17 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-1329] Decimal trancation issuewhen running the aggegate</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1329</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Due to space limitation I attached all code as a file. &lt;br/&gt;
Consider code sample 1 and 2. They do exactly the same aggregation. They output result using the same LiabilitySetTotals class. This class has few decimal properties. In the DB those values are double. Therefore those properties have &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonRepresentation(BsonType.Double, AllowTruncation = true)&amp;#93;&lt;/span&gt; attribute. &lt;/p&gt;

&lt;p&gt;When I use &quot;inline&quot; style of building group expression for aggregation using BsonDocument, output result as a document and convert it to my LiabilitySetTotals, all works fine.&lt;/p&gt;

&lt;p&gt;But when I use Linq to build group expression using the LiabilitySetTotals directly, I get an error:&lt;br/&gt;
System.FormatException : An error occurred while deserializing the TotalAmount property of class ...LiabilitySetTotals: Truncation resulted in data loss.&lt;/p&gt;

&lt;p&gt;It looks like aggregation does not pay attention to BsonRepresentation attribute.&lt;/p&gt;</description>
                <environment></environment>
        <key id="212040">CSHARP-1329</key>
            <summary>Decimal trancation issuewhen running the aggegate</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="lennygran">Lenny Granovsky</reporter>
                        <labels>
                    </labels>
                <created>Sat, 20 Jun 2015 13:49:52 +0000</created>
                <updated>Sat, 20 Jun 2015 17:40:26 +0000</updated>
                            <resolved>Sat, 20 Jun 2015 17:40:02 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="946313" author="craiggwilson" created="Sat, 20 Jun 2015 17:40:02 +0000"  >&lt;p&gt;Thanks Lenny,&lt;/p&gt;

&lt;p&gt;This is the same problem as &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1321&quot; title=&quot;Custom Serializers in $group&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1321&quot;&gt;&lt;del&gt;CSHARP-1321&lt;/del&gt;&lt;/a&gt;. When that gets handled, this will as well. It relates to the fact that the resulting type from the server may not be the same type as the aggregate. For instance, what does 1.0 + 1 result in? Certainly, the result is a likely a double in this case, but what serializer do we use? Either we use the standard double serializer, or we peruse all the fields inside the expression and see if there is a match. That works well until there are 2 matching serializers inside. &lt;/p&gt;

&lt;p&gt;Anyways, we&apos;ll figure something sensible out. Thanks for the report.&lt;br/&gt;
Craig&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="211035">CSHARP-1321</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="78790" name="jira issue submission.cs" size="4314" author="lennygran" created="Sat, 20 Jun 2015 13:49:52 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsainj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>