<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35: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>[CSHARP-52] bugs in generated JavaScript</title>
                <link>https://jira.mongodb.org/browse/CSHARP-52</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I was debugging one of my code and found interesting output for me. &lt;/p&gt;

&lt;p&gt;At the MongoQueryObject.Query there was text :&lt;/p&gt;

&lt;p&gt;{ &quot;$where&quot;: &lt;/p&gt;
{ &quot;$code&quot;: &quot;(((this.ServiceKey === 
4c46d7657c1a601774000002) &amp;amp;&amp;amp; (this.ResourceKey === 
4c46d7657c1a601774000003)) &amp;amp;&amp;amp; ((((this.Start &amp;gt;= 01/01/2000 10:00:00) 
&amp;amp;&amp;amp; (this.Start &amp;lt; 01/01/2000 18:00:00)) || ((this.End &amp;gt; 01/01/2000 
10:00:00) &amp;amp;&amp;amp; (this.End &amp;lt;= 01/01/2000 18:00:00))) || ((this.Start &amp;lt; 
01/01/2000 10:00:00) &amp;amp;&amp;amp; (this.End &amp;gt; 01/01/2000 18:00:00))))&quot; }
&lt;p&gt; } &lt;/p&gt;

&lt;p&gt;As i understand from MongoDb docs after $where should be JavaScrip &lt;br/&gt;
code to run on server side. &lt;/p&gt;

&lt;p&gt;Question 1: why it didn&apos;t translated into json notation to find &lt;br/&gt;
document ? &lt;br/&gt;
Answer: maybe because we have more then one condition per field &lt;/p&gt;

&lt;p&gt;Question 2: if it is JavaScript code, why values don&apos;t have quotes &lt;br/&gt;
&apos;4c46d7657c1a601774000002&apos; and &apos;01/01/2000 10:00:00&apos; &lt;/p&gt;

&lt;p&gt;Maybe better make like the following &lt;br/&gt;
              this.End &amp;lt;= new Date(2000,1,1,18,0,0) &lt;/p&gt;

&lt;p&gt;link: &lt;a href=&quot;http://groups.google.com/group/mongodb-csharp/browse_thread/thread/b00e288d0ebce78&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://groups.google.com/group/mongodb-csharp/browse_thread/thread/b00e288d0ebce78&lt;/a&gt;&lt;/p&gt;</description>
                <environment>VS2008, .NET 3.5</environment>
        <key id="12500">CSHARP-52</key>
            <summary>bugs in generated JavaScript</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="bug0r">Timofei Mironov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 21 Jul 2010 13:03:35 +0000</created>
                <updated>Thu, 22 Jul 2010 06:28:33 +0000</updated>
                            <resolved>Wed, 21 Jul 2010 20:25:19 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="16035" author="bug0r" created="Thu, 22 Jul 2010 06:28:33 +0000"  >&lt;p&gt;        public static string SerializeForServerSide(object value)&lt;br/&gt;
        {&lt;br/&gt;
...&lt;br/&gt;
--&amp;gt;          sb.AppendFormat(&quot;new Date(&lt;/p&gt;
{0},{1},{2},{3},{4},{5},{6})&quot;, d.Year, d.Month, d.Date, d.Hour, d.Minute, d.Second, d.Millisecond);&lt;br/&gt;
....&lt;br/&gt;
        }&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
to&lt;br/&gt;
&lt;br/&gt;
                sb.AppendFormat(&quot;new Date({0}
&lt;p&gt;,&lt;/p&gt;
{1}
&lt;p&gt;,&lt;/p&gt;
{2}
&lt;p&gt;,&lt;/p&gt;
{3}
&lt;p&gt;,&lt;/p&gt;
{4}
&lt;p&gt;,&lt;/p&gt;
{5}
&lt;p&gt;,&lt;/p&gt;
{6}
&lt;p&gt;)&quot;, d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, d.Millisecond);&lt;/p&gt;

&lt;p&gt;Should be d.Day instead of d.Date.                              &lt;/p&gt;</comment>
                            <comment id="16034" author="bug0r" created="Thu, 22 Jul 2010 06:27:27 +0000"  >&lt;p&gt;Fix this code. from&lt;/p&gt;</comment>
                            <comment id="16024" author="craiggwilson" created="Wed, 21 Jul 2010 20:25:19 +0000"  >&lt;p&gt;This is fixed in my fork: &lt;a href=&quot;http://github.com/craiggwilson/mongodb-csharp&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/craiggwilson/mongodb-csharp&lt;/a&gt;&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|hrh9zb:</customfieldvalue>

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