<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:04:33 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>[CXX-1991] Not  a legal mongodb url address provided</title>
                <link>https://jira.mongodb.org/browse/CXX-1991</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Hello, I use mongocxx API to do some demo.&lt;/p&gt;

&lt;p&gt;Our remote server is built on mongodb.&lt;/p&gt;

&lt;p&gt;It can be visited via JavaScript and Python.&lt;/p&gt;

&lt;p&gt;Currently, I want to wrap some MongoDB C++ APIs to use with other applications based on C++.&lt;/p&gt;

&lt;p&gt;I wrote the code as:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;int main() {&lt;br/&gt;
    // The mongocxx::instance constructor and destructor initialize and shut down the driver,&lt;br/&gt;
    // respectively. Therefore, a mongocxx::instance must be created before using the driver and&lt;br/&gt;
    // must remain alive for as long as the driver is in use.&lt;br/&gt;
    using bsoncxx::builder::basic::kvp;&lt;br/&gt;
    using bsoncxx::builder::basic::make_document;&lt;br/&gt;
    mongocxx::instance inst{};&lt;/p&gt;

&lt;p&gt;    mongocxx::client conn{mongocxx::uri{&quot;http://192.168.888.888&quot;}};&lt;br/&gt;
    auto db = conn&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;video-label&amp;quot;&amp;#93;&lt;/span&gt;;&lt;br/&gt;
    std::string video_id = &quot;sf-252261&quot;;&lt;br/&gt;
    //&#25343;&#21040;&#35270;&#39057;&lt;br/&gt;
    auto result = db.run_command(make_document(kvp(&quot;id&quot;, video_id)));&lt;br/&gt;
    std::cout &amp;lt;&amp;lt; bsoncxx::to_json(result) &amp;lt;&amp;lt; std::endl;&lt;/p&gt;

&lt;p&gt;    try &lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {
        //No need to insert, just to write.
        //query_top_level_find_keyboard_data(db, video_id);
        //query_top_level_fields_examples(db);
        //query_embedded_documents_examples(db);
        //query_arrays_examples(db);
        //query_array_embedded_documents_examples(db);
        //query_null_missing_fields_examples(db);
    }&lt;/span&gt; &lt;/div&gt;
&lt;p&gt; catch (const std::logic_error&amp;amp; e) &lt;/p&gt;
&lt;div class=&quot;error&quot;&gt;&lt;span class=&quot;error&quot;&gt;Unknown macro: {
        std}&lt;/span&gt; &lt;/div&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;My launch command is:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;c++ --std=c++17 find_piano_query_demo.cpp -o find_piano_query_demo    -I/opt/mongo-cxx-driver/include/mongocxx/v_noabi     -I/opt/mongo-cxx-driver/include/bsoncxx/v_noabi     -L/usr/local/lib -lmongocxx -lbsoncxx&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;It is OK for compilation but report error in running:&lt;br/&gt;
l&lt;blockquote&gt;&lt;p&gt;ibc++abi.dylib: terminating with uncaught exception of type mongocxx::v_noabi::logic_error: an invalid MongoDB URI was provided&lt;br/&gt;
Abort trap: 6&lt;/p&gt;&lt;/blockquote&gt;&lt;/p&gt;



&lt;p&gt;Looks like this statement &quot;mongocxx::client conn{mongocxx::uri{&quot;http://192.168.888.888&quot;}};&quot; is not correct. Thus, what is the legal statement of Mongodb URL with IP address?&lt;/p&gt;

&lt;p&gt;Since there is no clear guide for mongodb-c++ development, I just imitate some demo code, may have problem.&lt;/p&gt;

&lt;p&gt;Thanks &amp;amp; Regards!&lt;/p&gt;</description>
                <environment></environment>
        <key id="1314087">CXX-1991</key>
            <summary>Not  a legal mongodb url address provided</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="1921shanghai@gmail.com">&#33707; &#33707;</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Apr 2020 08:49:06 +0000</created>
                <updated>Fri, 27 Oct 2023 13:13:36 +0000</updated>
                            <resolved>Wed, 15 Apr 2020 19:22:18 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3040175" author="1921shanghai@gmail.com" created="Wed, 15 Apr 2020 08:41:26 +0000"  >&lt;p&gt;Looks like use &quot;mongodb://&quot; instead of &quot;http://&quot;,  can resolve this problem.&lt;/p&gt;</comment>
                            <comment id="3039152" author="kevin.albertson" created="Tue, 14 Apr 2020 16:51:06 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=1921shanghai%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;1921shanghai@gmail.com&quot;&gt;1921shanghai@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;The connection string should be of the form: &quot;mongodb://192.168.888.888&quot;. The MongoDB manual includes a reference for valid connection strings:&#160;&lt;a href=&quot;https://docs.mongodb.com/manual/reference/connection-string/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/connection-string/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For future reference, the CXX Jira project is generally limited to bug reports or feature requests. Please feel free to post any questions on the MongoDB Community forum in the &lt;a href=&quot;https://community.mongodb.com/c/drivers-odms-connectors/7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Drivers, ODMs, and Connectors&lt;/a&gt; category tagged with &lt;a href=&quot;https://community.mongodb.com/tag/cxx-driver&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;cxx-driver&lt;/a&gt;.&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|hx2nav:</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>