[teiid-issues] [JBoss JIRA] (TEIID-3040) MongoDB: Remove the IDREF fields for the FK fields
Steven Hawkins (JIRA)
issues at jboss.org
Mon Jun 22 11:28:13 EDT 2015
[ https://issues.jboss.org/browse/TEIID-3040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steven Hawkins closed TEIID-3040.
---------------------------------
> MongoDB: Remove the IDREF fields for the FK fields
> --------------------------------------------------
>
> Key: TEIID-3040
> URL: https://issues.jboss.org/browse/TEIID-3040
> Project: Teiid
> Issue Type: Enhancement
> Reporter: Ramesh Reddy
> Assignee: Ramesh Reddy
> Fix For: 8.7.1, 8.9
>
>
> TEIID-2958 has been working towards removing the IDREF fields from embedded documents. I see no reason to represent FK in the parent table with IDREF either. This will make the document model representation simple and aligns with how a typical developer would design.
> If the schema looks like
> {code}
> CREATE FOREIGN TABLE Customer (
> id integer PRIMARY KEY,
> firstName string,
> lastName string,
> email_addr string,
> FORIEGN KEY (email_addr) REFERENCES Email(address)
> );
> CREATE FOREIGN TABLE Email (
> address string PRIMARY KEY,
> provider string
> ) OPTIONS ("teiid_mongo:MERGE" 'Customer');
> {code}
> Currently Teiid writes the document as
> {code}
> Customer
> {
> "_id" : 1,
> "firstName" : "Ramesh",
> "lastName" : "Reddy",
> "email_addr" : DBRef("EMail", "abc at abc.com"),
> "EMail" : {
> "_id": "abc at abc.com",
> "provider" : "Comcast"
> }
> }
> {code}
> change to:
> {code}
> customer
> {
> "_id" : 1,
> "firstName" : "Ramesh",
> "lastName" : "Reddy",
> "email_addr" : "abc at abc.com",
> "EMail" : {
> "provider" : "Comcast"
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the teiid-issues
mailing list