<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:26:19 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>[COMPASS-896] Document how Compass handles special escape sequences in input fields</title>
                <link>https://jira.mongodb.org/browse/COMPASS-896</link>
                <project id="13182" key="COMPASS">Compass </project>
                    <description>&lt;h2&gt;&lt;a name=&quot;OriginalBugReport&quot;&gt;&lt;/a&gt;Original Bug Report &lt;/h2&gt;

&lt;p&gt;1. Try to insert the doc with double backslash in one of the values, for example &lt;/p&gt;
{User: &quot;DOMAIN\\someuser&quot;}
&lt;p&gt;2. Try to query for value containing two backslashes&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Taskonthisticket&quot;&gt;&lt;/a&gt;Task on this ticket&lt;/h2&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Document (e.g. in Jira ticket / Google Doc) the behavior for all Compass string input fields&lt;/li&gt;
	&lt;li&gt;Explain background in a few paragraphs: How does escaping work in Javascript / JSON, how does MongoDB store the string in BSON?&lt;/li&gt;
&lt;/ul&gt;


&lt;h5&gt;&lt;a name=&quot;FreetextStringInputFields&quot;&gt;&lt;/a&gt;Freetext String Input Fields&lt;/h5&gt;

&lt;p&gt;Document current behavior of &quot;Insert Document&quot; input handling of special character sequences, including&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;single backslash&lt;/li&gt;
	&lt;li&gt;double backslash&lt;/li&gt;
	&lt;li&gt;double-quote&lt;/li&gt;
	&lt;li&gt;newline (backslash followed by n)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;See e.g. &lt;a href=&quot;https://mathiasbynens.be/notes/javascript-escapes&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Single Character Escape Sequences&lt;/a&gt; in JavaScript. &lt;/p&gt;

&lt;p&gt;Document what was inserted, how it is stored in MongoDB (e.g. inspection via mongo shell or mongoexport) and how it is displayed in Compass.&lt;/p&gt;

&lt;p&gt;Fields to check:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Insert Document: key names&lt;/li&gt;
	&lt;li&gt;Insert Document: string values&lt;/li&gt;
	&lt;li&gt;Create Database names&lt;/li&gt;
	&lt;li&gt;Create Collection names&lt;/li&gt;
	&lt;li&gt;Query Bar inputs (filter keys and values, project/sort keys only)&lt;/li&gt;
	&lt;li&gt;Create Index: key names&lt;/li&gt;
	&lt;li&gt;Document Validation: key names and string values (regex, ranges, equal/not equal, json view)&lt;/li&gt;
	&lt;li&gt;Delete Database / Collection confirmation dialog&lt;/li&gt;
	&lt;li&gt;Connect dialog fields&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;For example, for Query Bar:&lt;br/&gt;
Document current behavior of &quot;Query Bar&quot; input handling of special character sequences, including the same as above. What was typed, what query was sent to the server (see e.g. mongo logs with db.setLogLevel(1)) and what documents from above were matched with the query.&lt;/p&gt;

&lt;h5&gt;&lt;a name=&quot;FutureWork&quot;&gt;&lt;/a&gt;Future Work &lt;/h5&gt;

&lt;p&gt;Based on the outcome of the reproduction and documentation of current behavior, we can make a decision on what the desired behavior should be and create appropriate tickets to implement this.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Create COMPASS task ticket to add info sprinkles to explain to user&lt;/li&gt;
	&lt;li&gt;Create DOCS ticket to turn this report into a user-facing documentation&lt;/li&gt;
	&lt;li&gt;Create tickets to resolve inconsistencies between query bar / crud / doc validation / ...&lt;/li&gt;
&lt;/ul&gt;



&lt;h5&gt;&lt;a name=&quot;FurtherResourcesandTools&quot;&gt;&lt;/a&gt;Further Resources and Tools&lt;/h5&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.json.org/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.json.org/&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://bsonspec.org/spec.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://bsonspec.org/spec.html&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://docs.mongodb.com/manual/reference/program/mongoreplay/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/program/mongoreplay/&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://docs.mongodb.com/manual/reference/program/bsondump/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/program/bsondump/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="363154">COMPASS-896</key>
            <summary>Document how Compass handles special escape sequences in input fields</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="aleksey.savateyev">Aleksey Savateyev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Mar 2017 02:11:13 +0000</created>
                <updated>Wed, 10 Jan 2024 23:07:13 +0000</updated>
                            <resolved>Thu, 30 Jun 2022 10:27:04 +0000</resolved>
                                    <version>1.6.0</version>
                                                    <component>CRUD</component>
                    <component>Query</component>
                        <due></due>
                            <votes>1</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="4649953" author="jessica.sigafoos" created="Thu, 30 Jun 2022 10:27:04 +0000"  >&lt;p&gt;Thank you for your feedback!  If this issue is still relevant to you, please vote on or file a feature request at &lt;a href=&quot;https://feedback.mongodb.com/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://feedback.mongodb.com/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2068758" author="vladimir.camaj@gmail.com" created="Wed, 21 Nov 2018 08:34:25 +0000"  >&lt;p&gt;Hi, problem with escape slash also appears in using regular expressions. This regexp&#160;{&lt;tt&gt;&quot;publishDate&quot;: &lt;b&gt;{$regex: &apos;^\d{4}&lt;del&gt;\d{2}&lt;/del&gt;\d{2}&lt;span class=&quot;error&quot;&gt;&amp;#91;T&amp;#93;&lt;/span&gt;\d{2}:\d{2}:\d{2}&lt;span class=&quot;error&quot;&gt;&amp;#91;+&amp;#93;&lt;/span&gt;&apos; }}&lt;/b&gt;&lt;/tt&gt;&#160; should match the date but match nothing. I am sure it is a bug. RoboMongo resolves it right.&#160; It seems the problem is the &lt;b&gt;\d&lt;/b&gt; should be escaped like &lt;b&gt;&lt;br class=&quot;atl-forced-newline&quot; /&gt;d&lt;/b&gt; if it should work.&lt;/p&gt;</comment>
                            <comment id="1523126" author="thomasr" created="Mon, 13 Mar 2017 23:47:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lucas.hrabovsky&quot; class=&quot;user-hover&quot; rel=&quot;lucas.hrabovsky&quot;&gt;lucas.hrabovsky&lt;/a&gt; agree we need more reproduction and docu, but moving it back to &quot;Needs Triage&quot; won&apos;t get the work done. If that&apos;s what we need, let&apos;s put that in the ticket and make it actionable. &lt;/p&gt;

&lt;p&gt;Update: done.&lt;/p&gt;</comment>
                            <comment id="1522862" author="sam.weaver@10gen.com" created="Mon, 13 Mar 2017 18:55:39 +0000"  >&lt;p&gt;Do you guys need me or Aleksey to provide more info here?&lt;/p&gt;</comment>
                            <comment id="1522644" author="lucas.hrabovsky" created="Mon, 13 Mar 2017 16:27:45 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=thomasr&quot; class=&quot;user-hover&quot; rel=&quot;thomasr&quot;&gt;thomasr&lt;/a&gt; the difference is that the query bar currently uses JSON whereas CRUD does not.&lt;/p&gt;

&lt;p&gt;This is a tricky case to handle as double backslash is itself a special character. I&apos;ve moved this back into &quot;Needs Triage&quot; as I believe more thorough reproduction steps need to be included and documentation of existing behavior.&lt;/p&gt;
</comment>
                            <comment id="1522121" author="thomasr" created="Mon, 13 Mar 2017 00:48:36 +0000"  >&lt;p&gt;It seems that Compass uses both above interpretations inconsistently in different areas. CRUD (insert/read document) seems to use literal interpretation, while the Query Bar seems to use the special character interpretation. This also explains why the document can&apos;t be found any more when searching for double backslashes. You would need 4 backslashes to find it again.&lt;/p&gt;
</comment>
                            <comment id="1522120" author="thomasr" created="Mon, 13 Mar 2017 00:45:31 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sam.weaver&quot; class=&quot;user-hover&quot; rel=&quot;sam.weaver&quot;&gt;sam.weaver&lt;/a&gt;, we don&apos;t know what the actual behavior should be. There are two choices: &lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Literal interpretation: any characters the user types get inserted literally into the document. For example, typing &quot;\n&quot; inserts a backslash and an n character into the string. It seems the user here expected this behavior.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Special character interpretation (like mongo shell): special escape characters or sequences are interpreted and replaced, for example typing &quot;\n&quot; inserts a newline character.&lt;/li&gt;
&lt;/ul&gt;


</comment>
                            <comment id="1521594" author="sam.weaver@10gen.com" created="Fri, 10 Mar 2017 21:27:48 +0000"  >&lt;p&gt;Actually, this is a different bug. Compass can&apos;t handle slashes in values properly.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Value in shell:&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;58c319a69b8e353d7773f362&quot;), &quot;user&quot; : &quot;DOMAIN\\sam&quot; }

&lt;p&gt;Value in Compass is shown as only having a single slash instead of a double slash:&lt;br/&gt;
user:&quot;DOMAIN\sam&quot;&lt;/p&gt;

&lt;p&gt;Searching for &lt;/p&gt;
{user:&quot;DOMAIN\\sam&quot;}
&lt;p&gt; in the compass query bar returns the document showing a single slash which is confusing.&lt;/p&gt;

&lt;p&gt;More confusing is that if I insert a document with a double slash in Compass UI, it is stored with 4 slashes in the server:&lt;/p&gt;

{ &quot;_id&quot; : ObjectId(&quot;58c31929dfc14c1c48bd9fc0&quot;), &quot;user&quot; : &quot;DOMAIN\\\\user&quot; }</comment>
                            <comment id="1520809" author="aleksey.savateyev" created="Fri, 10 Mar 2017 08:10:34 +0000"  >&lt;p&gt;IN the second step I meant searching for any text containing double backslash.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="230194">SERVER-20451</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="371882">COMPASS-1014</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 10 Mar 2017 21:27:48 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 31 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_14262" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>End date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 28 Mar 2017 23:59:59 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>jessica.sigafoos@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 31 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>aleksey.savateyev</customfieldvalue>
            <customfieldvalue>jessica.sigafoos@mongodb.com</customfieldvalue>
            <customfieldvalue>lucas.hrabovsky</customfieldvalue>
            <customfieldvalue>sam.weaver</customfieldvalue>
            <customfieldvalue>thomas.rueckstiess@mongodb.com</customfieldvalue>
            <customfieldvalue>vladimir.camaj@gmail.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht3yuf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrai7j:</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>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_14261" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 10 Mar 2017 00:00:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrqdjz:</customfieldvalue>

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