<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:41 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-1467] Support of Inline Conditional-to-FilterDefinition</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1467</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;As a developer I want to be able to use iniline conditional statement in lamda expressions that generate filter definitions.&lt;/p&gt;

&lt;p&gt;Example: &lt;br/&gt;
var posts = await blogContext.Posts.Find(p =&amp;gt; (tag != null) ? p.Tags.Contains(tag) : true).ToListAsync();&lt;/p&gt;

&lt;p&gt;currently in version 2.0.0.788 the above throws an error:&lt;br/&gt;
Unsupported filter: IIF(False, Serialization(Tags).Contains(null), True).&lt;/p&gt;</description>
                <environment></environment>
        <key id="237342">CSHARP-1467</key>
            <summary>Support of Inline Conditional-to-FilterDefinition</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</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="gpanagopoulos">Georgios Panagopoulos</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Nov 2015 19:31:47 +0000</created>
                <updated>Thu, 3 Dec 2020 17:14:20 +0000</updated>
                            <resolved>Thu, 3 Dec 2020 17:14:20 +0000</resolved>
                                    <version>2.0.1</version>
                                                    <component>API</component>
                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3514619" author="jeff.yemin" created="Thu, 3 Dec 2020 17:14:20 +0000"  >&lt;p&gt;Closing as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1771&quot; title=&quot;Support IIF method (i.e. ternary operator) in LINQ&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1771&quot;&gt;&lt;del&gt;CSHARP-1771&lt;/del&gt;&lt;/a&gt;, which is also about support for &lt;tt&gt;IIF&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="3310281" author="JIRAUSER1252706" created="Tue, 28 Jul 2020 17:07:29 +0000"  >&lt;p&gt;Hello. As I can see now Mongodb supports &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/query/expr/#op._S_expr&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/operator/query/expr/#op._S_expr&lt;/a&gt; which allows to translate this query.&lt;/p&gt;

&lt;p&gt;Can this be revisited?&lt;/p&gt;</comment>
                            <comment id="1077197" author="gpanagopoulos" created="Mon, 2 Nov 2015 20:13:54 +0000"  >&lt;p&gt;Hi Craig,&lt;/p&gt;

&lt;p&gt;Thanks for getting back to me. I wouldn&apos;t expect it to be so difficult but it really depends on the internal implementation of the driver. Since you know the framework very well, I am sure that you are right. Feel free to reject the feature to keep the backlog clean. I can always try to implement it locally in a cloned repository and if I have any success then I can share the code and we can take it from there!&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                            <comment id="1077159" author="craiggwilson" created="Mon, 2 Nov 2015 19:43:48 +0000"  >&lt;p&gt;Hi Georgios,&lt;/p&gt;

&lt;p&gt;Thanks so much for the offer and the idea. Unfortunately, the MongoDB query language does not support this syntax in a query nor in a $match aggregation stage. It is supported, however, in a $project or $group stage and is already incorporated into the driver: &lt;a href=&quot;http://mongodb.github.io/mongo-csharp-driver/2.1/reference/driver/expressions/#cond&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongodb.github.io/mongo-csharp-driver/2.1/reference/driver/expressions/#cond&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In theory, it would be possible to change this into a relatively complex $or statement: (tag != null &amp;amp;&amp;amp; tags.Contains(tag)) || tag == null). This would, I believe, be rather difficult to automatically translate correctly in all cases when it would be simpler to require the user to provide us this expression themselves.&lt;/p&gt;

&lt;p&gt;What are your thoughts?&lt;br/&gt;
Craig&lt;/p&gt;</comment>
                            <comment id="1077148" author="gpanagopoulos" created="Mon, 2 Nov 2015 19:32:47 +0000"  >&lt;p&gt;If accepted, please assign the issue to myself. I would like to become a contributor.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="318683">CSHARP-1771</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|hse3vr:</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>