<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:59:29 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-532] Converting to json String format has lost back ward compatibility</title>
                <link>https://jira.mongodb.org/browse/CXX-532</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;While using mongo2.2, got bson and converted to jsonString using the api provided, I upgraded my driver to use mongo2.6, The json format returned do not match with the existing json format.&lt;br/&gt;
Example :&lt;br/&gt;
mongo2.2 : &lt;/p&gt;
{&quot;myData&quot; : 1}
&lt;p&gt;mong2.6 : {&quot;myData&quot; : {$numberLong : 1}}&lt;/p&gt;

&lt;p&gt;Please provide us an solution.&lt;/p&gt;</description>
                <environment></environment>
        <key id="184100">CXX-532</key>
            <summary>Converting to json String format has lost back ward compatibility</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="4">Incomplete</resolution>
                                        <assignee username="andrew.morrow@mongodb.com">Andrew Morrow</assignee>
                                    <reporter username="nagavpk">NagavelpandiK</reporter>
                        <labels>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Fri, 13 Feb 2015 10:33:10 +0000</created>
                <updated>Wed, 17 Jun 2015 17:47:36 +0000</updated>
                            <resolved>Wed, 17 Jun 2015 17:47:36 +0000</resolved>
                                    <version>legacy-0.0-26compat-2.6.7</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="943229" author="acm" created="Wed, 17 Jun 2015 17:47:36 +0000"  >&lt;p&gt;Closing as &apos;incomplete&apos; because there is still not a clear description of the expected vs actual output, or example code that demonstrates the problem.&lt;/p&gt;

&lt;p&gt;Feel free to re-open if you have time to provide the information we are requesting.&lt;/p&gt;</comment>
                            <comment id="938417" author="acm" created="Thu, 11 Jun 2015 22:53:53 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nagavpk&quot; class=&quot;user-hover&quot; rel=&quot;nagavpk&quot;&gt;nagavpk&lt;/a&gt; -  Could you please provide a complete (compilable and runnable) example that shows what you want to do, and then what the expected and actual outputs are? I think that would help us move this ticket towards a resolution. Also, could you you please describe which version of the driver you were using when you got the output you desired and how you obtained that driver, and which driver you are using now, when you get the undesired output?&lt;/p&gt;
</comment>
                            <comment id="901888" author="nagavpk" created="Thu, 30 Apr 2015 11:27:07 +0000"  >&lt;p&gt;I am sorry i did not reply you, I used legacy driver with JsonStringFormat::JS as argument but no change in response&lt;/p&gt;</comment>
                            <comment id="870164" author="adam.midvidy" created="Wed, 1 Apr 2015 14:12:41 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nagavpk&quot; class=&quot;user-hover&quot; rel=&quot;nagavpk&quot;&gt;nagavpk&lt;/a&gt; - I am going to close this ticket. If you need further help, let me know and I will reopen it.&lt;/p&gt;</comment>
                            <comment id="868898" author="adam.midvidy" created="Tue, 31 Mar 2015 14:34:42 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nagavpk&quot; class=&quot;user-hover&quot; rel=&quot;nagavpk&quot;&gt;nagavpk&lt;/a&gt; did the above solution work for you?&lt;/p&gt;</comment>
                            <comment id="863944" author="adam.midvidy" created="Wed, 25 Mar 2015 18:01:11 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nagavpk&quot; class=&quot;user-hover&quot; rel=&quot;nagavpk&quot;&gt;nagavpk&lt;/a&gt;, the above solution of using JsonStringFormat::JS should work with the legacy driver. I am assuming that is what you mean by &quot;mongo3 driver&quot;.&lt;/p&gt;

&lt;p&gt;Adam&lt;/p&gt;</comment>
                            <comment id="855622" author="nagavpk" created="Tue, 17 Mar 2015 14:18:46 +0000"  >&lt;p&gt;Hi,&lt;br/&gt;
Is the issue solved in mongo3? We are moving to mongo3 driver.&lt;/p&gt;</comment>
                            <comment id="836974" author="tyler@10gen.com" created="Wed, 25 Feb 2015 16:10:50 +0000"  >&lt;p&gt;Oh, that should be relatively easy to resolve. In your application&apos;s request handler just use mongo::JsonStringFormat::JS as the format when calling tojson in order to craft the response to the client:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://api.mongodb.org/cxx/legacy-1.0.0/namespacemongo.html#ad907608317d02cc29dab225747bd791b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/cxx/legacy-1.0.0/namespacemongo.html#ad907608317d02cc29dab225747bd791b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="836655" author="nagavpk" created="Wed, 25 Feb 2015 05:25:20 +0000"  >&lt;p&gt;Tyler Brock,&lt;br/&gt;
In my current application using mongo2.2 i am returning the jsonstring to browser and parsed the json. In C++ to retrieve the json i shall use mongo::fromjson(); But in the browser i am paring the json as given. For example i have stored user details &lt;/p&gt;
{id : 1, name : &quot;name&quot;}
&lt;p&gt;. I query the user details as BSON converted to jsonString using toJsonStrong function then sent it to browser; I have got the value of id as double. But now mongo2.6 returns {id : {$double : 1}}, How shall i parse this in browser. Should we modify the application client js for this? If that is the case, I have to change in hundred places.&lt;/p&gt;

&lt;p&gt;My problem is the json format is not returned as available in mongo2.2&lt;br/&gt;
My suggestion is please provide a function to get the json in the format in mongo2.2 without type specifications (&lt;/p&gt;
{id : 1}
&lt;p&gt; not {id : {$double : 1}})&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Pandi&lt;/p&gt;</comment>
                            <comment id="836274" author="tyler@10gen.com" created="Tue, 24 Feb 2015 21:04:55 +0000"  >&lt;p&gt;NagavelpandiK,&lt;/p&gt;

&lt;p&gt;If I understand the scenario you described correctly it seems like the newer 2.6 version has actually gained round-trip ability. Before, no matter what type the number mydata was originally it would always be re-serialized into BSON as a a double. The newer version encodes the type information as extended JSON as a 64 bit integer (number long) so that you don&apos;t loose the type information. You should be able use the mongo::fromjson() function to get it back into BSONObj form:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://api.mongodb.org/cxx/current/namespacemongo.html#a6afa47c3e31b0942d21af793f02715b2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/cxx/current/namespacemongo.html#a6afa47c3e31b0942d21af793f02715b2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I did not understand correctly it would be very helpful if you could distill the problematic code into a self contained working example (without any omissions) so that I can try to definitively resolve the issue for you.&lt;/p&gt;</comment>
                            <comment id="829923" author="acm" created="Mon, 16 Feb 2015 14:40:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=nagavpk&quot; class=&quot;user-hover&quot; rel=&quot;nagavpk&quot;&gt;nagavpk&lt;/a&gt; RE building legacy-1.0.0 with boost 1.47. Officially, our minimum required boost is 1.49. However, in practice, we would expect it to build with older boost versions, maybe back to 1.41 or so.&lt;/p&gt;

&lt;p&gt;Could you provide some additional details on what errors you get when building the legacy driver against boost 1.47? If is is an easy fix we will try to apply it for our next patch release.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Andrew&lt;/p&gt;</comment>
                            <comment id="829766" author="nagavpk" created="Mon, 16 Feb 2015 04:21:50 +0000"  >&lt;p&gt;Hi Tyler Brock,&lt;/p&gt;

&lt;p&gt;I have stored the details of an user in mongodb, while logging-in I query the db and directly send the details to the browser.&lt;br/&gt;
As we are using json as response for the services, i converted the bson result to jsonString using bson.jsonString() function.&lt;/p&gt;

&lt;p&gt;The code is :&lt;/p&gt;

&lt;p&gt;std::string myService(.....){&lt;br/&gt;
mongo::BSONObj result = .......My service operation.....&lt;br/&gt;
return buildResponse(result);&lt;br/&gt;
}&lt;br/&gt;
std::string buildResponse(const mongo::BSONObj&amp;amp; result){&lt;br/&gt;
return result.jsonString();&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;And Could we build legacy-1.0.0 driver using boost version 1.47.&lt;br/&gt;
I could not build it. I am using boost version 1.47.&lt;/p&gt;

&lt;p&gt;Thanks for replying&lt;/p&gt;</comment>
                            <comment id="828809" author="tyler@10gen.com" created="Fri, 13 Feb 2015 15:41:19 +0000"  >&lt;p&gt;Hey NagavelpandiK,&lt;/p&gt;

&lt;p&gt;If you are moving to a new version of the driver we highly suggest you move to the legacy-1.0.0 driver rather than 26compat. Can you provide us with a snippet of the code that you are having trouble with? (preferably in a github gist or something of that sort)&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|hrenif:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>161869</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="313">Platform 0 3/13/15</customfieldvalue>
    <customfieldvalue id="452">Platform 1 04/03/15</customfieldvalue>
    <customfieldvalue id="567">Platform 5 06/26/16</customfieldvalue>

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