<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38:29 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-1034] ArgumentNullException when building Pull command on array element without nested property</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1034</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Following code fails with ArgumentNullException:&lt;/p&gt;

&lt;p&gt;            var participants = new[] &lt;/p&gt;
{ 123, 456, 789 }
&lt;p&gt;;&lt;br/&gt;
            var builder = new MongoDB.Driver.Builders.UpdateBuilder&amp;lt;Domain.Match&amp;gt;();&lt;br/&gt;
            var mongoQuery = builder.Pull(m =&amp;gt; m.ParticipantNumbers, query =&amp;gt; query.Where(p =&amp;gt; participants.Contains(p))); //This line fails with the exception&lt;/p&gt;


&lt;p&gt;Stack trace:&lt;br/&gt;
System.ArgumentNullException: Value cannot be null.&lt;br/&gt;
Parameter name: name&lt;br/&gt;
   at MongoDB.Driver.Builders.Query.In(String name, IEnumerable`1 values)&lt;br/&gt;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildMethodCallQuery(MethodCallExpression methodCallExpression)&lt;br/&gt;
   at MongoDB.Driver.Linq.PredicateTranslator.BuildQuery(Expression expression)&lt;br/&gt;
   at Test.TestClass.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass4.&amp;lt;TestMethod&amp;gt;b&lt;/em&gt;_3(QueryBuilder`1 query) in c:\dev\TestClass.cs:line 44&lt;br/&gt;
   at MongoDB.Driver.Builders.UpdateBuilder`1.Pull&lt;span class=&quot;error&quot;&gt;&amp;#91;TValue&amp;#93;&lt;/span&gt;(Expression`1 memberExpression, Func`2 elementQueryBuilderFunction)&lt;br/&gt;
. . .&lt;/p&gt;

&lt;p&gt;My guesses:&lt;br/&gt;
It fails when calling query.Where() with lambda expression having no property access: p =&amp;gt; participants.Contains(p). (p is a scalar value and used directly by its value). If I change the lambda to some complex object that has a property then it works: query.Where(complexObject =&amp;gt; participants.Contains(complexObject.ParticipantNumber)). It seems that the query translator is able to translate expressions with properties only.&lt;/p&gt;</description>
                <environment></environment>
        <key id="152393">CSHARP-1034</key>
            <summary>ArgumentNullException when building Pull command on array element without nested property</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="neleus">Neleus</reporter>
                        <labels>
                    </labels>
                <created>Wed, 13 Aug 2014 15:11:01 +0000</created>
                <updated>Sat, 4 Apr 2015 22:32:53 +0000</updated>
                            <resolved>Sat, 4 Apr 2015 22:32:53 +0000</resolved>
                                    <version>1.9.1</version>
                                                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="872959" author="craiggwilson" created="Sat, 4 Apr 2015 22:32:53 +0000"  >&lt;p&gt;We have rewritten the builders in 2.0 and will not be fixing this.&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|hs1bxr:</customfieldvalue>

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