<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:43:06 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-2638] Truncation resulted in data loss when Sum (Linq)</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2638</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Good morning,&lt;/p&gt;

&lt;p&gt;I&apos;m face with this issue:&lt;/p&gt;

&lt;p&gt;I have property &lt;em&gt;Total&lt;/em&gt; in my MongoDB stored as &lt;em&gt;Double&lt;/em&gt; type.&lt;/p&gt;

&lt;p&gt;I get all Total as IQueryable&amp;lt;decimal&amp;gt; in my c# code and I call Sum but I received this error:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;b&gt;Truncation resulted in data loss&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Code is:&lt;/p&gt;

&lt;p&gt;var foo = bar.GetCollection&amp;lt;MyClass&amp;gt;(&quot;MyCollectionName&quot;).AsQueryable()&lt;br/&gt;
 .Where(x =&amp;gt; x.MyProperty == 10)&lt;br/&gt;
 .Sum(x =&amp;gt; x.Total);&lt;/p&gt;

&lt;p&gt;&#160;This not works&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;This problem there is not if I use IEnumerable:&lt;/p&gt;

&lt;p&gt;var foo = bar.GetCollection&amp;lt;MyClass&amp;gt;(&quot;MyCollectionName&quot;).AsQueryable()&lt;br/&gt;
 .Where(x =&amp;gt; x.MyProperty == 10)&lt;b&gt;.AsEnumerable()&lt;/b&gt;&lt;br/&gt;
 .Sum(x =&amp;gt; x.Total);&lt;/p&gt;

&lt;p&gt;This works&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="802578">CSHARP-2638</key>
            <summary>Truncation resulted in data loss when Sum (Linq)</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="9">Done</resolution>
                                        <assignee username="wan.bachtiar@mongodb.com">Wan Bachtiar</assignee>
                                    <reporter username="mini-dev-1">Mini Dev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jun 2019 09:37:42 +0000</created>
                <updated>Thu, 25 Jun 2020 02:28:13 +0000</updated>
                            <resolved>Thu, 25 Jun 2020 02:28:13 +0000</resolved>
                                    <version>2.8.0</version>
                    <version>2.8.1</version>
                                                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3223192" author="rachelle.palmer" created="Thu, 25 Jun 2020 02:28:13 +0000"  >&lt;p&gt;Hi there, thank you for reaching out to MongoDB. As this sounds more like a support issue, I wanted to give you some resources to get this question answered more quickly:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;our MongoDB support portal, located at &lt;a href=&quot;https://support.mongodb.com/welcome&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;support.mongodb.com&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;our MongoDB community forums, located &lt;a href=&quot;https://developer.mongodb.com/community/forums/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;If you are an Atlas customer, there is free support offered 24/7 in the lower right hand corner of the UI.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Thank you!&lt;br/&gt;
Rachelle&lt;/p&gt;</comment>
                            <comment id="2308826" author="mini-dev-1" created="Tue, 2 Jul 2019 09:52:59 +0000"  >&lt;p&gt;I solved with the following attribute:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;[BsonRepresentation(BsonType.Double, AllowTruncation = &lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;)]&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                    </comments>
                    <attachments>
                    </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|huuct3:</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>