This content has been marked as final.
Show 3 replies
-
1. Re: Teiid Embedded - Add new Mongodb collection
rareddy Nov 26, 2016 11:17 AM (in response to mtawk)In the "DDL" based metadata configuration, you can add the DDL for a table and use that as collection. When you use that table, it will be written as collection in the MongoDB. Look at the documentation on MongoDB translator on how to do this MongoDB Translator · Teiid Documentation
-
2. Re: Teiid Embedded - Add new Mongodb collection
mtawk Nov 28, 2016 10:42 AM (in response to rareddy)I have already read the Mongodb Translator documentation but i did not find a java example that illustrates how to add a new Mongodb collection to metadata; since i'm using Teiid embedded.
-
3. Re: Teiid Embedded - Add new Mongodb collection
rareddy Nov 28, 2016 11:04 AM (in response to mtawk)From your other post Teiid Embedded connect to Mongodb if you add following to the code I provided it will work
String ddl = "CREATE FOREIGN TABLE Customer ( customer_id integer, FirstName varchar(25), LastName varchar(25) ) OPTIONS(UPDATABLE 'TRUE');"; modelMetaData.addSourceMetadata("DDL", ddl);
This adds a collection called Customer. It does not matter embedded or server, metadata is same both places.