<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:50 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-1513] How to run query specified below using c# driver </title>
                <link>https://jira.mongodb.org/browse/CSHARP-1513</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I am running following query in RoboMongo which seems to work fine.&lt;br/&gt;
db.runCommand(&lt;br/&gt;
{&quot;find&quot;:&quot;Equity&quot;,&quot;filter&quot;:{&quot;Ticker&quot;: &quot;IBM US Equity&quot;}}&lt;br/&gt;
)&lt;/p&gt;

&lt;p&gt;I want to run same query using C# driver version - 1.10.1.73&lt;br/&gt;
I see following error while running query:&lt;br/&gt;
Command &apos;find&apos; failed: Failed to parse: filter: &quot;&apos;Ticker&apos;: &apos;IBM US Equity&apos;&quot;. &apos;filter&apos; field must be of BSON type Object. (response: &lt;/p&gt;
{ &quot;waitedMS&quot; : NumberLong(0), &quot;ok&quot; : 0.0, &quot;errmsg&quot; : &quot;Failed to parse: filter: \&quot;&apos;Ticker&apos;: &apos;IBM US Equity&apos;\&quot;. &apos;filter&apos; field must be of BSON type Object.&quot;, &quot;code&quot; : 9 }
&lt;p&gt;)&lt;/p&gt;
</description>
                <environment></environment>
        <key id="244080">CSHARP-1513</key>
            <summary>How to run query specified below using c# driver </summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="nikhilsalunkhe@gmail.com">Nikhil Salunkhe</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Tue, 15 Dec 2015 22:05:54 +0000</created>
                <updated>Fri, 5 Apr 2019 13:58:23 +0000</updated>
                            <resolved>Mon, 4 Jan 2016 20:20:33 +0000</resolved>
                                    <version>1.10.1</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1116227" author="nikhilsalunkhe@gmail.com" created="Wed, 16 Dec 2015 17:26:27 +0000"  >&lt;p&gt;Out of interest is there a method/call inside .NET driver where i can pass&lt;br/&gt;
Mongo query as string and get result back.&lt;br/&gt;
So far I seen that C# driver is strongly types.&lt;/p&gt;

&lt;p&gt;e.g&lt;br/&gt;
RunCommand(string(MongoQuery))&lt;/p&gt;

&lt;p&gt;Thank you in advance.&lt;/p&gt;

&lt;p&gt;Nikhil&lt;/p&gt;



&lt;p&gt;On Tue, Dec 15, 2015 at 11:07 PM, Nikhil Salunke &amp;lt;nikhilsalunkhe@gmail.com&amp;gt;&lt;/p&gt;
</comment>
                            <comment id="1115735" author="nikhilsalunkhe@gmail.com" created="Wed, 16 Dec 2015 04:07:27 +0000"  >&lt;p&gt;Great!.&lt;/p&gt;

&lt;p&gt;This works as expected.&lt;/p&gt;

&lt;p&gt;Reason we are trying to call find command the way it is called because we&lt;br/&gt;
have database management solution TimeScape&lt;br/&gt;
&amp;lt;&lt;a href=&quot;http://www.xenomorph.com/solutions/timescape-edm/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.xenomorph.com/solutions/timescape-edm/&lt;/a&gt;&amp;gt; which manages financial&lt;br/&gt;
data.&lt;br/&gt;
Data store for TimeScape product could be any kind of database such SQL or&lt;br/&gt;
Mongo or any proprietary database.&lt;br/&gt;
We are passing Mongo DB queries from TimeScape product API which in turns&lt;br/&gt;
goes TimeScape product query engine and then talks to Mongo C# api&lt;br/&gt;
underneath and returns result as shon below.&lt;/p&gt;


&lt;p&gt;Thank you, Robert.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;image: Inline image 1&amp;#93;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Nikhil&lt;/p&gt;


&lt;p&gt;On Tue, Dec 15, 2015 at 10:26 PM, Robert Stam (JIRA) &amp;lt;jira@mongodb.org&amp;gt;&lt;/p&gt;
</comment>
                            <comment id="1115700" author="rstam" created="Wed, 16 Dec 2015 03:25:44 +0000"  >&lt;p&gt;I can&apos;t quite read your code to create the command, but it looks like you are setting the filter field to a string instead of a query document.&lt;/p&gt;

&lt;p&gt;It should 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;var command = new CommandDocument&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;{&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;    { &quot;find&quot;, &quot;Equity&quot; },&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;    { &quot;filter&quot;, new BsonDocument { { &quot;Ticker&quot;, &quot;IBM US Equity&quot; } }&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;};&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;Also, you wouldn&apos;t normally call the find command yourself. Just use the Find methods on MongoCollection and let the driver do the find using whatever protocol is appropriate for the version of the server you are connected to.&lt;/p&gt;

&lt;p&gt;The API for version 2.x of the driver is slightly different.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="243543">CSHARP-1502</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="102357" name="C# Source Code.txt" size="609" author="nikhilsalunkhe@gmail.com" created="Tue, 15 Dec 2015 22:05:54 +0000"/>
                            <attachment id="102358" name="Mongo Error.png" size="52490" author="nikhilsalunkhe@gmail.com" created="Tue, 15 Dec 2015 22:05:54 +0000"/>
                            <attachment id="102492" name="image.png" size="55999" author="nikhilsalunkhe@gmail.com" created="Wed, 16 Dec 2015 17:26:27 +0000"/>
                            <attachment id="102392" name="image.png" size="55999" author="nikhilsalunkhe@gmail.com" created="Wed, 16 Dec 2015 04:07:27 +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|hsf0jj:</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>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="802">C# Sprint 29</customfieldvalue>

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