<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:57:40 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-2615] Snake Case</title>
                <link>https://jira.mongodb.org/browse/JAVA-2615</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hi, guys!&lt;/p&gt;

&lt;p&gt;Struggling trying to find a default naming strategy config and seems like it just not there.&lt;/p&gt;

&lt;p&gt;So if it&apos;s possible - would be very grateful for smthing like .setNamingStrategy(NamingStrategy.SNAKE_CASE..&lt;/p&gt;

&lt;p&gt;Thx&lt;/p&gt;</description>
                <environment>MongoDB java driver</environment>
        <key id="433814">JAVA-2615</key>
            <summary>Snake Case</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="5" iconUrl="https://jira.mongodb.org/images/icons/priorities/trivial.svg">Trivial - P5</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="alex.blokh">Aleksandr Blokh</reporter>
                        <labels>
                    </labels>
                <created>Wed, 27 Sep 2017 16:24:43 +0000</created>
                <updated>Wed, 11 Sep 2019 19:15:12 +0000</updated>
                            <resolved>Wed, 8 Nov 2017 14:01:21 +0000</resolved>
                                                                    <component>POJO</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1690311" author="ross@10gen.com" created="Thu, 5 Oct 2017 15:24:19 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alex.blokh&quot; class=&quot;user-hover&quot; rel=&quot;alex.blokh&quot;&gt;alex.blokh&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;This would be easier to do with your own custom convention.  Custom Conventions can easily be set globally via the &lt;tt&gt;PojoCodecProvider.Builder.conventions(conventions)&lt;/tt&gt; method.  See the &lt;a href=&quot;http://mongodb.github.io/mongo-java-driver/3.5/bson/pojos/#conventions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;conventions&lt;/a&gt; documentation.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/r3.5.0/bson/src/test/unit/org/bson/codecs/pojo/PojoCustomTest.java#L114-L145&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;PojoCustomTest&lt;/a&gt; case has an example of a custom convention that looks like it could suit your needs. Just don&apos;t forget to also include the &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/r3.5.0/bson/src/main/org/bson/codecs/pojo/Conventions.java#L55-L56&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;default conventions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope that helps,&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                            <comment id="1688613" author="alex.blokh" created="Wed, 4 Oct 2017 06:38:57 +0000"  >&lt;p&gt;Yes, I&apos;m talking about field names in documents&lt;/p&gt;

&lt;p&gt;Now, if I have a camelCase field name in java -&amp;gt; it goes the same camelCase key name to a mongodb document&lt;br/&gt;
And the only possible way I found to change that behavior is to annotate field with&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: gray; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;@BsonProperty&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;(value = &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;snake_case_key&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt; &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;167141_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/167141/167141_Screen+Shot+2017-10-04+at+09.33.10.png&quot; title=&quot;Screen Shot 2017-10-04 at 09.33.10.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;167141&quot; file-preview-title=&quot;Screen Shot 2017-10-04 at 09.33.10.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/167141/_thumb_167141.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt; &lt;br/&gt;
That&apos;s why I was looking for a solution of a global configuration of naming strategy.&lt;/p&gt;

&lt;p&gt;For example Jackson library has ObjectMapper with a &lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;It&apos;s fairly straightforward. &lt;/p&gt;

&lt;p&gt;If that&apos;s possible with a convention it would be very helpful to write a snippet in documentation on that. Cause I found nothing on stackoverflow about that&lt;/p&gt;

&lt;p&gt;Thanks a lot, guys!&lt;/p&gt;</comment>
                            <comment id="1683971" author="ross@10gen.com" created="Thu, 28 Sep 2017 07:15:49 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alex.blokh&quot; class=&quot;user-hover&quot; rel=&quot;alex.blokh&quot;&gt;alex.blokh&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Please could you add some context to the ticket, I&apos;m unclear as to what exactly you are asking for.  If it&apos;s regarding field names in Documents then they are set on insertion.  If this is regarding the POJO Codec then you should add a custom &lt;a href=&quot;http://mongodb.github.io/mongo-java-driver/3.5/bson/pojos/#conventions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;convention&lt;/a&gt; to change the read and write property names to the format you require.&lt;/p&gt;

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

&lt;p&gt;Ross&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="167141" name="Screen Shot 2017-10-04 at 09.33.10.png" size="44742" author="alex.blokh" created="Wed, 4 Oct 2017 06:34:09 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <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|ht7ohb:</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>