<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:40:27 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-1713] Need Powershell to access mongodb v3.x</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1713</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I had a powershell script that was access mongodb 2.x with the csharpdriver 1.7 from 10gen, now the mongodb is v3.x and the script is failing on credentials, I have upgraded to the latest csharpdriver and still can not gain access to the v3.x version of mongodb&lt;/p&gt;</description>
                <environment></environment>
        <key id="301790">CSHARP-1713</key>
            <summary>Need Powershell to access mongodb v3.x</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="rjurek">Ross Jurek</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Mon, 18 Jul 2016 11:53:09 +0000</created>
                <updated>Fri, 5 Apr 2019 13:58:55 +0000</updated>
                            <resolved>Thu, 18 Aug 2016 13:34:39 +0000</resolved>
                                                                    <component>Connectivity</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1329585" author="craiggwilson" created="Wed, 20 Jul 2016 11:51:30 +0000"  >&lt;p&gt;I&apos;m not a powershell guru, so you&apos;re gonna have to work through this a bit on your own I&apos;m afraid. Here is the API documentation for the class: &lt;a href=&quot;http://api.mongodb.com/csharp/2.2/html/T_MongoDB_Driver_MongoClientExtensions.htm&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.com/csharp/2.2/html/T_MongoDB_Driver_MongoClientExtensions.htm&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I&apos;ve likely made a mistake in my powershell syntax. I&apos;d be great to use the new API instead, but it&apos;s full of generics and I seem to recall that powershell doesn&apos;t play with generics very well.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                            <comment id="1328225" author="rjurek" created="Tue, 19 Jul 2016 12:23:35 +0000"  >&lt;p&gt;I get an error that MongoClientExtensions does not exist.&lt;/p&gt;</comment>
                            <comment id="1327676" author="craiggwilson" created="Mon, 18 Jul 2016 22:14:19 +0000"  >&lt;p&gt;Ross,&lt;/p&gt;

&lt;p&gt;I think if you add &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;$server = [MongoClientExtensions]::GetServer($client)&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;before&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;$database = $client.GetDatabase($dbName)&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;Your code should continue to work. In the new API, GetCollection is a generic method. &lt;/p&gt;

&lt;p&gt;If you&apos;d like to see better support for powershell from the .NET Driver team, please create a new ticket with the request. So far, there hasn&apos;t been a whole lot of interest.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                            <comment id="1327292" author="rjurek" created="Mon, 18 Jul 2016 17:47:49 +0000"  >&lt;p&gt;------ driver 1.7 from 10gen, mongo 2.6 - This code gives a credential error when changing to the 3.2.1 mongodb use old driver, changed to new driver, error that create method does not exist.&lt;br/&gt;
 $mongoDbDriverPath = &quot;C:\utilities\mongoDB_1\&quot;&lt;br/&gt;
 $dbName = &quot;Prod&quot;&lt;br/&gt;
 $collectionName = &quot;Collect&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Driver.dll&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Driver.Core.dll&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Bson.dll&quot;&lt;br/&gt;
 $db = &lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Driver.MongoDatabase&amp;#93;&lt;/span&gt;::Create(&quot;mongodb://user:password@server/$($dbname)&quot;)&lt;br/&gt;
 $collection = $db&lt;span class=&quot;error&quot;&gt;&amp;#91;$collectionName&amp;#93;&lt;/span&gt;&lt;br/&gt;
 $query = &lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Driver.Builders.Query&amp;#93;&lt;/span&gt;::AND(&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Driver.Builders.Query&amp;#93;&lt;/span&gt;::EQ(&quot;Result&quot;,&quot;Response status code does not indicate success: 403 (Forbidden).&quot;),&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Driver.Builders.Query&amp;#93;&lt;/span&gt;::EQ(&quot;ItemName&quot;,&quot;Automatic but Stopped Services&quot;))&lt;br/&gt;
 $results = $collection.find($query)&lt;/p&gt;




&lt;p&gt;------ 2.6 csharpdriver, mongodb 3.2.1 - get Cannot find an overload for &quot;GetCollection&quot; and the argument count: &quot;1&quot;.&lt;/p&gt;





&lt;p&gt;$mongoDbDriverPath = &quot;C:\utilities\mongoDB_2\&quot;&lt;br/&gt;
 $dbName = &quot;Prod&quot;&lt;br/&gt;
 $collectionName = &quot;Collect&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Driver.dll&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Driver.Core.dll&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Bson.dll&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Driver.GridFS.dll&quot;&lt;br/&gt;
 Add-Type -Path &quot;$($mongoDbDriverPath)\MongoDB.Driver.Legacy.dll&quot;&lt;br/&gt;
 $client = New-Object -TypeName MongoDB.Driver.MongoClient -ArgumentList &quot;mongodb://user:password@server&quot;&lt;/p&gt;

&lt;p&gt;$database = $client.GetDatabase($dbName)&lt;br/&gt;
 $collection = $database.GetCollection(&apos;collect&apos;)&lt;/p&gt;

&lt;p&gt;$query = &lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Driver.Builders.Query&amp;#93;&lt;/span&gt;::AND(&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Driver.Builders.Query&amp;#93;&lt;/span&gt;::EQ(&quot;Result&quot;,&quot;Response status code does not indicate success: 403 (Forbidden).&quot;),&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;MongoDB.Driver.Builders.Query&amp;#93;&lt;/span&gt;::EQ(&quot;ItemName&quot;,&quot;KO - Automatic but Stopped Services&quot;))&lt;/p&gt;

&lt;p&gt;$results = $collection.find($query)&lt;/p&gt;</comment>
                            <comment id="1327196" author="craiggwilson" created="Mon, 18 Jul 2016 16:55:56 +0000"  >&lt;p&gt;Hi Ross,&lt;/p&gt;

&lt;p&gt;Sorry you are having some trouble. In order to help, we need to see your script. I&apos;d also like to know exactly what version of MongoDB you were running and exactly what version of MongoDB you are now running. In addition, I need to know the exact version of the driver you are unable to connect with.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="301788">CSHARP-1712</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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsno9b:</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>