<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:41:17 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-57222] Foreign Key Constraint on field</title>
                <link>https://jira.mongodb.org/browse/SERVER-57222</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I have been working with MongoDB for quite some time and I find that with the proper schema design, it can fit most generic use cases.&lt;/p&gt;

&lt;p&gt;However there are cases where referencing between collections (SQL like) is unavoidable. In these cases, the biggest drawback with Mongo compared to SQL DBs is&#160; the &lt;b&gt;foreign key constraint inability&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;Even checking using application logic, isn&apos;t 100% correct, since if you check for the validity of the field value before inserting the document, you can&apos;t be sure that it wasn&apos;t deleted when you create it and you have to check after creation and apply compensating deletion - error handling.&lt;/p&gt;

&lt;p&gt;I believe an index functionality where it would assert the existence of the field&apos;s value in an other&apos;s collection index&#160; would be extremely helpful and remove this major drawback of Mongo compared to sequential databases,&#160; since the check in the database level would allow for proper foreign key constraint.&lt;/p&gt;

&lt;p&gt;Tried to find similar issues - feature requests but didn&apos;t find any, that&apos;s why I created this one.&lt;/p&gt;

&lt;p&gt;Any thoughs on that?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1758125">SERVER-57222</key>
            <summary>Foreign Key Constraint on field</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="dimitris_ha@hotmail.com">Dimitris Halatsis</reporter>
                        <labels>
                            <label>constraint</label>
                            <label>foreign</label>
                            <label>index</label>
                            <label>key</label>
                            <label>reference</label>
                    </labels>
                <created>Wed, 26 May 2021 18:32:37 +0000</created>
                <updated>Tue, 6 Dec 2022 01:16:57 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="3891797" author="dimitris_ha@hotmail.com" created="Tue, 22 Jun 2021 16:21:24 +0000"  >&lt;p&gt;Thanks for the update!&lt;/p&gt;

&lt;p&gt;Looking forward to the team&apos;s feedback&lt;/p&gt;</comment>
                            <comment id="3891428" author="kyle.suarez" created="Tue, 22 Jun 2021 15:08:17 +0000"  >&lt;p&gt;Thanks for the feature request, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dimitris_ha%40hotmail.com&quot; class=&quot;user-hover&quot; rel=&quot;dimitris_ha@hotmail.com&quot;&gt;dimitris_ha@hotmail.com&lt;/a&gt;. We are adding this to the Query Team project backlog for consideration.&lt;/p&gt;</comment>
                            <comment id="3884590" author="dimitris_ha@hotmail.com" created="Thu, 17 Jun 2021 13:35:30 +0000"  >&lt;p&gt;Hi @EricSedor and thanks for replying to my issue. I appreciate taking it over to the appropriate team for consideration. I believe it is something worth working on.&lt;/p&gt;

&lt;p&gt;Regarding your suggestion, wouldn&apos;t it be more intuitive if the options you mentioned (namespace - collection, indexed field), were defined in the index options? Since they regard the index definition and for it to work properly, it can only rely on index existence?&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;</comment>
                            <comment id="3882251" author="eric.sedor" created="Wed, 16 Jun 2021 19:51:49 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dimitris_ha%40hotmail.com&quot; class=&quot;user-hover&quot; rel=&quot;dimitris_ha@hotmail.com&quot;&gt;dimitris_ha@hotmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;I&apos;ll pass this to an appropriate team to consider. One initial thought I have is that one way to provide this feature might be a syntax for referencing a namespace and indexed field within &lt;a href=&quot;https://docs.mongodb.com/manual/core/schema-validation/#other-query-expressions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;document validators&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Eric&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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 27 May 2021 15:14:09 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 33 weeks, 1 day 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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 33 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>dimitris_ha@hotmail.com</customfieldvalue>
            <customfieldvalue>eric.sedor@mongodb.com</customfieldvalue>
            <customfieldvalue>kyle.suarez@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzhx1r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2igv:</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_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[eric.sedor@mongodb.com]]></customfieldvalue>
    

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

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