<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:34:31 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>[SERVER-14330] Applying Array.isArray to a field containing a hyphen</title>
                <link>https://jira.mongodb.org/browse/SERVER-14330</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I have a program which inspects every field in a document to see if it an array.&lt;/p&gt;

&lt;p&gt;This works fine for:&lt;/p&gt;

&lt;p&gt;db.bios.find({$where: &quot;Array.isArray(this.awards)&quot;})&lt;br/&gt;
&amp;lt;Returns values&amp;gt;&lt;/p&gt;

&lt;p&gt;But not for&lt;/p&gt;

&lt;p&gt;db.messages.find({$where: &quot;Array.isArray(this.X-cc)&quot;})&lt;br/&gt;
error: &lt;/p&gt;
{ &quot;$err&quot; : &quot;ReferenceError: cc is not defined&quot;, &quot;code&quot; : 16722 }

&lt;p&gt;If I single-quote the parameter value in isArray it breaks the working use case:&lt;/p&gt;

&lt;p&gt;db.bios.find({$where: &quot;Array.isArray(&apos;this.awards&apos;)&quot;})&lt;br/&gt;
&amp;lt;No rows return&amp;gt;&lt;/p&gt;

&lt;p&gt;and seems to fix the broken use case:&lt;br/&gt;
db.messages.find({$where: &quot;Array.isArray(this.X-cc)&quot;})&lt;br/&gt;
&amp;lt;No rows returned instead of an error&amp;gt;&lt;/p&gt;

&lt;p&gt;What I&apos;m looking for is a generic solution that can be used in both scenarios.&lt;/p&gt;

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

&lt;p&gt;Brad&lt;/p&gt;</description>
                <environment></environment>
        <key id="143392">SERVER-14330</key>
            <summary>Applying Array.isArray to a field containing a hyphen</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</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="9">Done</resolution>
                                        <assignee username="kamran.khan">Kamran K.</assignee>
                                    <reporter username="bmiller1009">Brad Miller</reporter>
                        <labels>
                    </labels>
                <created>Sat, 21 Jun 2014 01:43:14 +0000</created>
                <updated>Wed, 10 Dec 2014 23:11:45 +0000</updated>
                            <resolved>Tue, 8 Jul 2014 21:49:51 +0000</resolved>
                                    <version>2.6.1</version>
                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="662721" author="kamran.khan" created="Fri, 18 Jul 2014 04:47:26 +0000"  >&lt;p&gt;Glad to hear it worked!&lt;/p&gt;</comment>
                            <comment id="661830" author="bmiller1009" created="Thu, 17 Jul 2014 14:03:39 +0000"  >&lt;p&gt;Hi Kamran -&lt;/p&gt;

&lt;p&gt;Apologies for my delay in getting back to you.  Your suggestion worked perfectly.&lt;/p&gt;

&lt;p&gt;Thank you so much for your help.&lt;/p&gt;

&lt;p&gt;Brad&lt;/p&gt;</comment>
                            <comment id="646595" author="kamran.khan" created="Wed, 2 Jul 2014 22:50:26 +0000"  >&lt;p&gt;Hi Brad,&lt;/p&gt;

&lt;p&gt;Have you had a chance to try the bracket notation suggestion?&lt;/p&gt;</comment>
                            <comment id="629797" author="kamran.khan" created="Sat, 21 Jun 2014 02:09:16 +0000"  >&lt;p&gt;Hi Brad,&lt;/p&gt;

&lt;p&gt;&apos;X-cc&apos; is not a valid JavaScript identifier, so you can&apos;t use dot notation to access that property.  Instead, you should use bracket notation to avoid identifier restrictions with property names: Array.isArray(this[&apos;X-cc&apos;])&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors&lt;/a&gt; has a nice overview of bracket notation and dot notation for further reference.&lt;/p&gt;

&lt;p&gt;Hope that helps!&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sat, 21 Jun 2014 02:09:16 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 30 weeks, 5 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_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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 30 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>bmiller1009</customfieldvalue>
            <customfieldvalue>kamran.khan</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlsx3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrzwy7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>123893</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsgubj:</customfieldvalue>

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