<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:23 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-633] LINQ queries against collections of type MongoCollection&lt;BsonDocument&gt; are not supported</title>
                <link>https://jira.mongodb.org/browse/CSHARP-633</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;var collection = database.GetCollection(&quot;testconnection&quot;); &lt;br/&gt;
dynamic p = new MongoDB.Bson.ObjectModel.BsonDynamicDocument();&lt;/p&gt;

&lt;p&gt;p.Id = Guid.NewGuid();&lt;br/&gt;
collection.Insert(p);&lt;br/&gt;
var value = (Guid)p.Id;&lt;br/&gt;
var item2 = collection.AsQueryable().Where(item =&amp;gt; item.GetValue(&quot;Id&quot;) == value).FirstOrDefault();&lt;/p&gt;

&lt;p&gt;this is giving an error.&lt;/p&gt;


&lt;p&gt; I have attached a sample project and you can see it there. &lt;/p&gt;

</description>
                <environment></environment>
        <key id="57288">CSHARP-633</key>
            <summary>LINQ queries against collections of type MongoCollection&lt;BsonDocument&gt; are not supported</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="teodor.georgiev">Teodor Georgiev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Nov 2012 11:45:42 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:37 +0000</updated>
                            <resolved>Fri, 22 Nov 2013 14:46:47 +0000</resolved>
                                    <version>1.6.1</version>
                                    <fixVersion>1.9</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="460322" author="craiggwilson" created="Fri, 22 Nov 2013 15:05:11 +0000"  >&lt;p&gt;RC in December.  Probably full release in early January.&lt;/p&gt;</comment>
                            <comment id="460321" author="nebojsaveron" created="Fri, 22 Nov 2013 15:04:45 +0000"  >&lt;p&gt;Sounds great, when do you think 1.9 driver will be released?&lt;/p&gt;</comment>
                            <comment id="460307" author="craiggwilson" created="Fri, 22 Nov 2013 14:46:12 +0000"  >&lt;p&gt;This has been added to 1.9 and is already in master branch.  Syntax would look like this:&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;   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;// { &quot;x.y&quot; : { &quot;$gt&quot; : 10 } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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 results = from c in col.AsQueryable()&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;                    where c[&quot;x&quot;][&quot;y&quot;] &amp;gt; 10&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;                    select c;&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>
                            <comment id="459680" author="nebojsaveron" created="Thu, 21 Nov 2013 12:43:27 +0000"  >&lt;p&gt;This is still not supported in version 1.8.3?&lt;/p&gt;</comment>
                            <comment id="199242" author="teodor.georgiev" created="Mon, 26 Nov 2012 17:00:42 +0000"  >&lt;p&gt;Probably will go with Linq provider. That&apos;s not so complicated. I have done it already couple of times. Thank you for the response. &lt;/p&gt;</comment>
                            <comment id="199160" author="craiggwilson" created="Mon, 26 Nov 2012 15:28:38 +0000"  >&lt;p&gt;Well, it&apos;s now on the list and we won&apos;t remove it.  Also, feel free to submit a pull request at github adding this support into the existing linq provider.  That&apos;s probably much simpler than rewriting it...&lt;/p&gt;</comment>
                            <comment id="199153" author="teodor.georgiev" created="Mon, 26 Nov 2012 15:21:18 +0000"  >&lt;p&gt;Currently I am trying to build a framework based on C# that is using partially dynamic partially strongly typed objects. That&apos;s why i am using BsonDocument. Apart of that i would like to have a way to query object&apos;s dynamic properties and this is the reason why I am asking if you are planing to support this feature. In case that you will not support that I will have to rewrite your Linq provider to be able to do that.  &lt;/p&gt;</comment>
                            <comment id="199096" author="craiggwilson" created="Mon, 26 Nov 2012 13:56:51 +0000"  >&lt;p&gt;This is the first time it has been added to the list.  May I ask why you want to use Linq with a BsonDocument? It&apos;s a relatively large overhead for  very little benefit.  As you can see, there is a relatively simple workaround for this that also happens to be syntactically shorter.&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;   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;// preferred way to write this query...&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;collection.FindOne(Query.Eq(&quot;Id&quot;, value));&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>
                            <comment id="198962" author="teodor.georgiev" created="Mon, 26 Nov 2012 09:08:00 +0000"  >&lt;p&gt;Are you planing to support similar feature? &lt;/p&gt;</comment>
                            <comment id="197712" author="rstam" created="Sat, 24 Nov 2012 05:06:35 +0000"  >&lt;p&gt;We don&apos;t currently support LINQ queries against collections of type MongoCollection&amp;lt;BsonDocument&amp;gt;. LINQ queries are only supported against C# classes that expose their queryable values as public properties (or fields).&lt;/p&gt;

&lt;p&gt;I&apos;ve changed the description of this issue to more accurately reflect that fact.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="21921" name="Mongo.rar" size="5209538" author="teodor.georgiev" created="Fri, 23 Nov 2012 11:45:42 +0000"/>
                    </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|hrkpw7:</customfieldvalue>

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