<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:13:36 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>[CDRIVER-1917] Document use of server_id in mongoc_cursor_new_from_command_reply</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-1917</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;mongoc_cursor_new_from_command_reply takes a &quot;server_id&quot; parameter.  However, HLL wrappers that want to use this command to synthesize a cursor response have no idea what to put for that parameter.  I suspect that &quot;0&quot; is acceptable in such a case, but this is not documented.&lt;/p&gt;</description>
                <environment></environment>
        <key id="331814">CDRIVER-1917</key>
            <summary>Document use of server_id in mongoc_cursor_new_from_command_reply</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="david.golden@mongodb.com">David Golden</reporter>
                        <labels>
                    </labels>
                <created>Mon, 14 Nov 2016 23:11:25 +0000</created>
                <updated>Fri, 5 May 2017 19:41:32 +0000</updated>
                            <resolved>Fri, 5 May 2017 19:41:32 +0000</resolved>
                                                    <fixVersion>1.7.0</fixVersion>
                                    <component>docs</component>
                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1565987" author="xgen-internal-githook" created="Fri, 5 May 2017 19:41:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1917&quot; title=&quot;Document use of server_id in mongoc_cursor_new_from_command_reply&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1917&quot;&gt;&lt;del&gt;CDRIVER-1917&lt;/del&gt;&lt;/a&gt; update mongoc_cursor_new_from_command_reply.rst&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/65d43fbbfde2533df56c709fe470e699b7cc1af8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/65d43fbbfde2533df56c709fe470e699b7cc1af8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1435320" author="jesse" created="Wed, 16 Nov 2016 08:02:28 +0000"  >&lt;p&gt;That&apos;s safe and correct.&lt;/p&gt;</comment>
                            <comment id="1434292" author="david.golden" created="Tue, 15 Nov 2016 13:08:36 +0000"  >&lt;p&gt;For my purpose, it would be sufficient to say something like this:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;When synthesizing a complete cursor response (i.e. with cursor id 0), set the server_id to 0 as well.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;If that is, in fact, a safe and correct thing to do.&lt;/p&gt;</comment>
                            <comment id="1434172" author="jesse" created="Tue, 15 Nov 2016 08:11:27 +0000"  >&lt;p&gt;If you might send getMore commands for this cursor, then server id must be set in order to ensure you send them to the right server. Use it like this:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/d23e71f533748106486dbe8831e8ad7b33ecb820/tests/test-mongoc-cursor.c#L657-L657&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/blob/d23e71f533748106486dbe8831e8ad7b33ecb820/tests/test-mongoc-cursor.c#L657-L657&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Except this test uses some private APIs, so the full public API usage goes like this:&lt;/p&gt;

&lt;p&gt;Get a mongoc_server_description_t using mongoc_client_select_server, get its id with mongoc_server_description_id. Pass that as &quot;serverId&quot; in &quot;opts&quot; to mongoc_client_read_command_with_opts or a similar function. When you get the reply, pass the reply and server id to mongoc_cursor_new_from_command_reply.&lt;/p&gt;

&lt;p&gt;Do we need to document this? I&apos;ve been resisting it, since the whole server id API is designed for PHP&apos;s odd habit of selecting a server as a distinct step before executing operations on the server. I&apos;d rather guide regular C programmers away from server ids and away from mongoc_cursor_new_from_command_reply.&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|hsrvn3:</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>