<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:11 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-556] SelectMany LINQ operator not supported</title>
                <link>https://jira.mongodb.org/browse/CSHARP-556</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Lets say i have this simplified version of my task workflow:&lt;br/&gt;
public class TaskGraph&lt;br/&gt;
{&lt;br/&gt;
        &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonId&amp;#93;&lt;/span&gt;&lt;br/&gt;
        public BsonObjectId Id &lt;/p&gt;
{ get; set; }&lt;br/&gt;
        public List&amp;lt;Task&amp;gt; Tasks { get; set; }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;public class Task&lt;br/&gt;
{&lt;br/&gt;
        &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonId&amp;#93;&lt;/span&gt;&lt;br/&gt;
        public Guid Id &lt;/p&gt;
{ get; set; }&lt;br/&gt;
        public string AssignedTo { get; set; }
&lt;p&gt;        // other stuff elided&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;In this case, the following query (where I&apos;m trying to get all tasks assigned to me regardless of which workflow they are a part of):&lt;/p&gt;

&lt;p&gt;var db = DBUtils.GetMongoDB(&quot;taskpoc&quot;);&lt;br/&gt;
var queryCtx = db.GetCollection&amp;lt;TaskGraph&amp;gt;(&quot;TaskGraphs&quot;).AsQueryable();&lt;br/&gt;
var tasksAssignedToMe = queryCtx&lt;br/&gt;
   .SelectMany(tg =&amp;gt; tg.Tasks)&lt;br/&gt;
   .Where(t =&amp;gt; t.AssignedTo == &quot;tkrick&quot;);&lt;/p&gt;

&lt;p&gt;... throws the following exception:&lt;br/&gt;
System.NotSupportedException &lt;/p&gt;
{&quot;The SelectMany query operator is not supported.&quot;}

&lt;p&gt;This feature is to enable this to return those results.&lt;/p&gt;</description>
                <environment>windows 2k8 r2, using mongodb version 2.0.6 64-bit, using driver 1.6</environment>
        <key id="49868">CSHARP-556</key>
            <summary>SelectMany LINQ operator not supported</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="tkrick">Travis Krick</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Sep 2012 18:43:10 +0000</created>
                <updated>Wed, 20 Jan 2016 20:09:56 +0000</updated>
                            <resolved>Fri, 8 May 2015 13:31:12 +0000</resolved>
                                    <version>1.6</version>
                                    <fixVersion>2.1</fixVersion>
                                    <component>Linq</component>
                                        <votes>1</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="908598" author="xgen-internal-githook" created="Fri, 8 May 2015 13:30:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;craiggwilson&apos;, u&apos;name&apos;: u&apos;Craig Wilson&apos;, u&apos;email&apos;: u&apos;craiggwilson@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-556&quot; title=&quot;SelectMany LINQ operator not supported&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-556&quot;&gt;&lt;del&gt;CSHARP-556&lt;/del&gt;&lt;/a&gt;: Added support for SelectMany at the root level.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/3344e791464ddafb7b28fe1a666f445646783d59&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/3344e791464ddafb7b28fe1a666f445646783d59&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="181285" author="rstam" created="Thu, 1 Nov 2012 03:47:17 +0000"  >&lt;p&gt;Just to be clear, projection is already supported, just not in the most efficient way that is theoretically possible, since we always fetch the entire document and then do the projection. Projection does not require limiting the fields returned from the server, but rather limiting the fields is an optimization made possible by projection.&lt;/p&gt;

&lt;p&gt;We are definitely planning to use the projection to control which fields actually need to be returned from the server. See &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-456&quot; title=&quot;Support linq projections to only pull back referenced fields.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-456&quot;&gt;&lt;del&gt;CSHARP-456&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="181284" author="tkrick" created="Thu, 1 Nov 2012 03:40:55 +0000"  >&lt;p&gt;Understood. If hard to implement, projection can come in 2.0. but personally disagree with the downgrade to minor aspect. Not attempting to patronize, but with large docs, projection could limit the amount of data sent across the wire if a query returns many results. Projection &lt;span class=&quot;error&quot;&gt;&amp;#91;vertical slicing&amp;#93;&lt;/span&gt; is one of the main data operations, among filtering &lt;span class=&quot;error&quot;&gt;&amp;#91;horizontal slicing&amp;#93;&lt;/span&gt;, sorting, and grouping. The main differentiating factor for c# is linq, so this driver supporting as much of that functionality as possible would be great. Thanks for the hard work, much appreciated.&lt;/p&gt;</comment>
                            <comment id="180197" author="craiggwilson" created="Mon, 29 Oct 2012 18:39:10 +0000"  >&lt;p&gt;SelectMany is actually a very difficult operator to support.  We currently don&apos;t support Select either in the sense that it will still pull back the full document and run the projection client-side.&lt;/p&gt;

&lt;p&gt;Since there is another way to accomplish what you are doing by forming the query differently, I&apos;m going to downgrade this to a minor feature and target it at 2.0&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;  var tasksAssignedToMe = queryCtx.Where(tg =&amp;gt;tg.Tasks.Any(t =&amp;gt; t.AssignedTo == &quot;tkrick&quot;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;This will pull back all the TaskGraphs that have tasks assigned to you.  Subsequently, you can filter out the tasks client-side.  &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="112050">CSHARP-912</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CSHARP-935</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs7usv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>103725</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="506">C# Sprint 19</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>