<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:01 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>[JAVA-769] Facing issue while inserting data into mongodb</title>
                <link>https://jira.mongodb.org/browse/JAVA-769</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have an object inside my mongodb like this &lt;br/&gt;
{ &quot;_id&quot; : ObjectId(&quot;5129d8a4da06f4571f45d1a2&quot;), &lt;br/&gt;
&quot;User_Id&quot; : { &lt;br/&gt;
&quot;Profile&quot; : &lt;/p&gt;
{
&quot;Naveen_009&quot;: }
&lt;p&gt; } }.&lt;/p&gt;

&lt;p&gt;Now i want to check the profile value is Glamour_009,if result is true i want to insert data like this &lt;br/&gt;
&quot;Twitter&quot; : &lt;/p&gt;
{ 
&quot;08 Feb 2013&quot; : [ 11, 10, 0, 1 ],
&quot;09 Feb 2013&quot; : [ 890, 546, 35, 309 ], 
&quot;10 Feb 2013&quot; : [ 728, 458, 30, 240 ] }
&lt;p&gt;.&lt;/p&gt;

&lt;p&gt;To do this am using following logic.&lt;br/&gt;
BasicDBObject query =new BasicDBObject().append(&quot;009.Profile&quot;,&quot;Glamour_009&quot;);	 &lt;br/&gt;
BasicDBObject newDocument3 = new BasicDBObject().append(&quot;$set&quot;, new BasicDBObject(key,arrayObj));&lt;br/&gt;
collection.findAndModify(query, newDocument3);&lt;/p&gt;

&lt;p&gt;But as a result am getting result in some unneeded manner like this&lt;/p&gt;
{ &quot;009&quot; : 
{ &quot;Profile&quot; : 
{&quot;Glamour_009&quot;: }
&lt;p&gt;, &lt;br/&gt;
&quot;08 Feb 2013&quot; : [ 1253, 857, 55, 341 ], &lt;br/&gt;
&quot;09 Feb 2013&quot; : [ 890, 546, 35, 309 ], &lt;br/&gt;
&quot;10 Feb 2013&quot; : [ 728, 458, 30, 240 ] },&lt;br/&gt;
&quot;_id&quot; : ObjectId(&quot;5129bf1dda06f4709d2b98ee&quot;) }&lt;/p&gt;

&lt;p&gt;Help me to get required result if u suggest some books it il be help full too.&lt;/p&gt;




</description>
                <environment>Mac 10.6.8 OX</environment>
        <key id="66246">JAVA-769</key>
            <summary>Facing issue while inserting data into mongodb</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="naveen.coolest">Naveen Kumar</reporter>
                        <labels>
                    </labels>
                <created>Sun, 24 Feb 2013 11:02:02 +0000</created>
                <updated>Sun, 24 Feb 2013 20:19:25 +0000</updated>
                            <resolved>Sun, 24 Feb 2013 20:19:25 +0000</resolved>
                                    <version>2.6.5</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="274445" author="naveen.coolest" created="Sun, 24 Feb 2013 11:04:47 +0000"  >&lt;p&gt;My Mistake&lt;br/&gt;
Result am geting is&lt;/p&gt;
{ &quot;User_Id&quot; : 
{ &quot;Profile&quot; : 
{&quot;Naveen_009&quot;: }
&lt;p&gt;, &lt;br/&gt;
&quot;08 Feb 2013&quot; : [ 1253, 857, 55, 341 ], &lt;br/&gt;
&quot;09 Feb 2013&quot; : [ 890, 546, 35, 309 ], &lt;br/&gt;
&quot;10 Feb 2013&quot; : [ 728, 458, 30, 240 ] },&lt;br/&gt;
&quot;_id&quot; : ObjectId(&quot;5129bf1dda06f4709d2b98ee&quot;) }&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|hrmbzj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>43892</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>