<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:58: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>[JAVA-2955] ObjectId created in java code not inserted to document</title>
                <link>https://jira.mongodb.org/browse/JAVA-2955</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Halo,&lt;/p&gt;

&lt;p&gt;I tried inserting data through POJO, I made my own ObjectId in the POJO object with the code as below :&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;ObjectId oid = ObjectId.get();&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;res.set_id = oid;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;resCollection.insertOne(res);&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;the problem arises when I check the results of ObjectId, it is not the same as the code created with the data entered in the document,&#160;after I do the experiment, I see that the error is in the getter naming for ObjectId, here are the results:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;getId -&amp;gt; result : ObjectId created is same as the one entered in the document&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;getid -&amp;gt; resutl : ObjectId in document not the same as the code created&#160;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;get_Id -&amp;gt; resutl : ObjectId&#160;&lt;/tt&gt;&lt;tt&gt;in document }}{{ not the same as the code created&#160;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;get_id -&amp;gt; resutl : ObjectId&#160;&lt;/tt&gt;&lt;tt&gt;in document }}{{not the same as the code created&#160;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;from the three getter naming that failed to insert ObjectId to document,&#160;I don&apos;t see any additional fields in the collection (id, _Id),&#160;I am not sure this is a bug or not, but I think that this explanation is very necessary&lt;/p&gt;

&lt;p&gt;I also did some tests,&#160;my conclusion, the three getter naming that failed to enter the ObjectId to document,&#160;actually read by the POJO codec, but ignored &amp;amp; ObjectId was finally created by mongodb server&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Thahir&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>Windows 7 64 Bit, mongodb-driver 3.8.1</environment>
        <key id="598007">JAVA-2955</key>
            <summary>ObjectId created in java code not inserted to document</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="ataherster@yahoo.co.id">Ahmad Thahir</reporter>
                        <labels>
                    </labels>
                <created>Fri, 31 Aug 2018 08:16:59 +0000</created>
                <updated>Fri, 27 Oct 2023 13:21:06 +0000</updated>
                            <resolved>Mon, 3 Sep 2018 14:09:29 +0000</resolved>
                                    <version>4.0.0</version>
                                                    <component>Codecs</component>
                    <component>POJO</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1991829" author="ross@10gen.com" created="Mon, 3 Sep 2018 14:09:15 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ataherster%40yahoo.co.id&quot; class=&quot;user-hover&quot; rel=&quot;ataherster@yahoo.co.id&quot;&gt;ataherster@yahoo.co.id&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the ticket.  The PojoCodec requires properties to follow Java Bean convention and as the &lt;tt&gt;getid&lt;/tt&gt;, &lt;tt&gt;get_Id&lt;/tt&gt; and &lt;tt&gt;get_id&lt;/tt&gt; properties do not follow the Java Bean convention they are ignored. Custom &lt;tt&gt;PropertyModelBuilder&lt;/tt&gt; instances could be added to the &lt;tt&gt;ClassModelBuilder&lt;/tt&gt; to support these fields but it is not something that is supported by default.&lt;/p&gt;

&lt;p&gt;Just to let you know for future reference, this project is for Java driver bugs or feature requests. The best place for questions regarding MongoDB usage or the Java driver specifics is the &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user mailinglist&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stackoverflow&lt;/a&gt; as you will reach a boarder audience there.  If your business requires an answer from MongoDB within a time frame then we do offer &lt;a href=&quot;https://www.mongodb.com/products/production-support&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;production support&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All the best,&lt;/p&gt;

&lt;p&gt;Ross&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|htxe2f:</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>