-
1. Re: two tiered embedded structure
rareddy Dec 18, 2014 2:23 PM (in response to afrieden)Alex,
Nested MERGES are not supported feature yet, there is JIRA logged for this feature [TEIID-2561] Allow nested MERGE of entities in MongoDB translators - JBoss Issue Tracker
I know I have written some support for it, but later retracted to focus more on other features. It can get quite complex in terms of generating queries for MongoDB. I do not know, if I would have enough time in 8.10 time frame, but if you want submit a patch I am willing take a look.
Thanks
Ramesh.. -
2. Re: two tiered embedded structure
afrieden Dec 18, 2014 4:08 PM (in response to rareddy)Thanks Ramesh, is there a current workaround for this at the moment? I'm not sure how I would write a patch for this ATM.
-
3. Re: two tiered embedded structure
rareddy Dec 18, 2014 8:59 PM (in response to afrieden)Since both Sample and SQS1 are both joined as through "record_id", you can make them sibling documents, or combine into single table. However, it will not give the JSON structure you shown above.
-
4. Re: two tiered embedded structure
afrieden Dec 19, 2014 10:41 AM (in response to rareddy)the record_id join was just what was done in one of the examples. I am happy to try another way to translate the document structure. What would be an example of flattening out the embedded structure of sample and SQS1? Thanks!
-
5. Re: two tiered embedded structure
rareddy Dec 19, 2014 11:13 AM (in response to afrieden)What would be an example of flattening out the embedded structure of sample and SQS1? Thanks!
Define as single table?
-
6. Re: two tiered embedded structure
afrieden Dec 19, 2014 12:01 PM (in response to rareddy)How would I do this in the translator since they are embedded? Thanks!
-
7. Re: two tiered embedded structure
rareddy Dec 19, 2014 12:36 PM (in response to afrieden)Are using the (a) existing document structure in MongoDB or you are (b) creating a new document structure with Teiid. With (a) there is no good workaround currently, you can possibly treat the sub-document as an object or clob, with (b) you can define the table structure in the VDB like examples in the documentation, for example
- CREATE FOREIGN TABLE SQS1 (
- record_id varchar(100) PRIMARY KEY,
- score double,
- threshold varchar(100),
- pass boolean,
- FOREIGN KEY (record_id) REFERENCES sample (record_id)
- ) OPTIONS(UPDATABLE 'FALSE', "teiid_mongo:MERGE" 'records');