<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:25:51 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-73868] [Federated db] ISODate not working on a View with $project  </title>
                <link>https://jira.mongodb.org/browse/SERVER-73868</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Unable to use ISOdate or new date in $project of a view on a federated databse.&#160;&lt;/p&gt;

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

&lt;p&gt;as a user i want to create a view in a federated database based on a collection of a atlas cluster. Inside this view I use the pipeline $project. Everything works fine unless you want to use dates like ISODate or new Date. Then you get following error.&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
Data Lake storage config invalid (errors: [&lt;span class=&quot;error&quot;&gt;&amp;#91;database &amp;#39;db1&amp;#39;: view &amp;#39;test_dates&amp;#39;: pipeline failed to parse: invalid JSON input. Position: 38. Character: I&amp;#93;&lt;/span&gt;]).&lt;br/&gt;
&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2260192">SERVER-73868</key>
            <summary>[Federated db] ISODate not working on a View with $project  </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="yuan.fang@mongodb.com">Yuan Fang</assignee>
                                    <reporter username="anthonyviaene@gmail.com">Anthony Viaene</reporter>
                        <labels>
                            <label>Bug</label>
                    </labels>
                <created>Fri, 10 Feb 2023 09:32:46 +0000</created>
                <updated>Fri, 10 Feb 2023 21:31:22 +0000</updated>
                            <resolved>Fri, 10 Feb 2023 21:31:22 +0000</resolved>
                                    <version>5.0.14</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5187926" author="JIRAUSER1270794" created="Fri, 10 Feb 2023 21:29:50 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=anthonyviaene%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;anthonyviaene@gmail.com&quot;&gt;anthonyviaene@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for your report. If I understand correctly, you intended to create a view using an aggregation pipeline.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;create a view on that db and in the pipeline, you use any date command like ISODate or new Date.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;both ISODate() and new Date() are &lt;a href=&quot;https://www.mongodb.com/docs/manual/reference/method/Date/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongosh Methods&lt;/a&gt; for creating Date objects. However, I don&apos;t believe they are valid for use in the $project stage of an aggregation pipeline.&lt;/p&gt;

&lt;p&gt;Furthermore, the error message:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;pipeline failed to parse: invalid JSON input. Position: 38. Character: I&quot; suggests that there is a syntax error in the JSON input at position 38 and the character causing the error is &apos;I&apos;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;indicates that there is a syntax error in the JSON input at position 38 and the character causing the error is &apos;I&apos;. As previously stated, &quot;ISODate()&quot; is not a valid function in MongoDB&apos;s aggregation pipeline which resulted in a syntax error. To resolve the issue, I would suggest you check the operator &lt;a href=&quot;https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromString/#-datefromstring--aggregation-&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;$dateFromString (aggregation)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For any further questions, we&apos;d like to encourage you to start by asking our community for help by posting on the &lt;a href=&quot;https://www.mongodb.com/community/forums&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MongoDB Developer Community Forums&lt;/a&gt;. If the discussion there leads you to suspect a bug in the MongoDB server, then we&apos;d want to investigate it as a possible bug here in the SERVER project.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Yuan&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="431230" name="Screenshot 2023-02-10 at 10.19.32.png" size="82611" author="anthonyviaene@gmail.com" created="Fri, 10 Feb 2023 09:32:17 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.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 Feb 2023 21:29:50 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        51 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>yuan.fang@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            51 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>anthonyviaene@gmail.com</customfieldvalue>
            <customfieldvalue>yuan.fang@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1v8vj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1dp20:</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_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;add a db from a atalas cluster to federated database.&lt;/p&gt;

&lt;p&gt;create a view on that db and in the pipeline you use any date command like ISODate or new Date.&lt;br/&gt;
&#160;&lt;br/&gt;
error: Data Lake storage config invalid (errors: [&lt;span class=&quot;error&quot;&gt;&amp;#91;database &amp;#39;db1&amp;#39;: view &amp;#39;test_dates&amp;#39;: pipeline failed to parse: invalid JSON input. Position: 38. Character: I&amp;#93;&lt;/span&gt;]).&lt;br/&gt;
&#160;&lt;br/&gt;
example pipeline:&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
[{&lt;br/&gt;
&quot;$project&quot;:{&lt;br/&gt;
&quot;aborted_at&quot;:{&lt;br/&gt;
&quot;$cond&quot;:[&lt;/p&gt;
{
&quot;$gt&quot;:[
&quot;$aborted_at&quot;,ISODate(&quot;0001-01-01T00:00:00.000+0000&quot;)
]
}
&lt;p&gt;,&lt;/p&gt;
{
&quot;$toDate&quot;:&quot;$aborted_at&quot;
}
&lt;p&gt;,&lt;br/&gt;
null&lt;br/&gt;
]&lt;br/&gt;
}&lt;br/&gt;
}}]&lt;/p&gt;</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_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[yuan.fang@mongodb.com]]></customfieldvalue>
    

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

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