<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:08 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-1270] OData IQueryable Filters don&apos;t translate to MongoDB </title>
                <link>https://jira.mongodb.org/browse/CSHARP-1270</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;ODataQueryOptions.Filter uses Odata filters. These do not translate through to MongoDB syntax. This prevents MongoDB from being the backing store for an OData endpoint without plenty of extra work.&lt;/p&gt;

&lt;p&gt;Ex: StartsWith is enabled through a regular Queryable/Where Expression has call syntax Syntax &quot;.Call $e.Name.StartsWith(\&quot;X\&quot;)&quot;.  From the OData query, the RawFilter bceomes &quot;startswith(Name,&apos;MPMD&apos;)&quot; The MongoDB Driver doesn&apos;t understand that format. &lt;/p&gt;

&lt;p&gt;More examples of queries which don&apos;t translate: &lt;a href=&quot;http://www.odata.org/documentation/odata-version-2-0/uri-conventions/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.odata.org/documentation/odata-version-2-0/uri-conventions/&lt;/a&gt; &lt;/p&gt;</description>
                <environment></environment>
        <key id="202636">CSHARP-1270</key>
            <summary>OData IQueryable Filters don&apos;t translate to MongoDB </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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="thechopkins">Calvin Hopkins</reporter>
                        <labels>
                    </labels>
                <created>Thu, 7 May 2015 05:17:30 +0000</created>
                <updated>Tue, 26 May 2015 23:10:40 +0000</updated>
                            <resolved>Thu, 14 May 2015 21:37:24 +0000</resolved>
                                    <version>2.0</version>
                                                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="924063" author="craiggwilson" created="Tue, 26 May 2015 23:10:40 +0000"  >&lt;p&gt;Hi Calvin,&lt;/p&gt;

&lt;p&gt;Have you built the driver from source? As mentioned previously, we don&apos;t have the rewritten LINQ support in the 2.0 driver yet. It exists in master, but hasn&apos;t been distributed yet. In addition, we haven&apos;t spent anytime attempting to support OData, so I&apos;m sure there are some/many things that don&apos;t work. If you&apos;d like to provide me a sample project that illustrates the error you are seeing, I&apos;ll take a look.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                            <comment id="924054" author="thechopkins" created="Tue, 26 May 2015 23:02:13 +0000"  >&lt;p&gt;Hi Craig, &lt;br/&gt;
I just upgraded to the new client (v2.0), however I&apos;m still unable to pipe through the OData query option Expression for startswith.&lt;/p&gt;

&lt;p&gt;Extracting out the Expression from the ODataQuery gives me the following:&lt;br/&gt;
&quot;$it =&amp;gt; ((Convert(($it.Id == value(System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1&lt;span class=&quot;error&quot;&gt;&amp;#91;System.Int32&amp;#93;&lt;/span&gt;).TypedProperty)) AndAlso IIF((($it.ItemId == null) Or (value(System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1&lt;span class=&quot;error&quot;&gt;&amp;#91;System.String&amp;#93;&lt;/span&gt;).TypedProperty == null)), null, Convert($it.ItemId.StartsWith(value(System.Web.Http.OData.Query.Expressions.LinqParameterContainer+TypedLinqParameterContainer`1&lt;span class=&quot;error&quot;&gt;&amp;#91;System.String&amp;#93;&lt;/span&gt;).TypedProperty)))) == True)&quot;&lt;/p&gt;

&lt;p&gt;However, I then get the following exception when I pass that into the Predicate Translator:&lt;br/&gt;
   (Convert((Serialization(Id) == 20150525)) AndAlso IIF(((Serialization(ItemId) == null) Or False), null, Convert(Serialization(ItemId).StartsWith(&quot;Environment&quot;)))) is not supported.&lt;/p&gt;

&lt;p&gt;   at MongoDB.Driver.Linq.Translators.PredicateTranslator.GetSerializationInfo(Expression expression) in d:\jenkins\workspace\mongo-csharp-driver-build\src\MongoDB.Driver\Linq\Translators\PredicateTranslator.cs:line 1410&lt;/p&gt;

&lt;p&gt;This is all generated from the OData call (using linqpad):&lt;br/&gt;
    Collection.Where(a =&amp;gt; a.Id == 20150525 &amp;amp;&amp;amp; a.ItemId.StartsWith(&quot;Environment&quot;))&lt;/p&gt;

&lt;p&gt;Any thoughts on how I should be doing this differently, or where the potential issue might be occurring? &lt;/p&gt;</comment>
                            <comment id="907424" author="craiggwilson" created="Thu, 7 May 2015 12:01:03 +0000"  >&lt;p&gt;Hi Calvin,&lt;/p&gt;

&lt;p&gt;Thanks for the report. We don&apos;t have IQueryable support in the new API, so I assume you are referring to the old API. If that is the case, then we won&apos;t be fixing this. However, the new API should support most OData conventions. &lt;/p&gt;

&lt;p&gt;Craig&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|hs946v:</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>