The standard way to do this is by defining a JSON model for your
database and specifying this when using !connect, e.g.

!connect jdbc:calcite:model=path/to/model.json admin admin

An example for MongoDB can be seen at the link below. You'll see in
this case there are three schemas defined. The first two are simply
two different MongoDB databases. By default, the MongoDB adapter
exposes all collections as a single column named _MAP which is a SQL
map type and can be accessed to retrieve nested data. To make things
easier, you can define views over the data to flatten documents to
relational tables by specifying specific fields to extract. An example
of this is the final schema in the JSON below.

https://github.com/apache/calcite/blob/master/mongodb/src/test/resources/mongo-model.json

--
Michael Mior
mm...@uwaterloo.ca
Le lun. 23 juil. 2018 à 08:35, Satiz Kumar <citsathis...@gmail.com> a écrit :
>
> Hi,
>
> I have my mongodb locally running and I have a test database with a couple
> of tables.
> I have calcite installed and working fine with a sample .json file.
>
> How to I connect to my mongoDB running database and query those 2 tables?
> How do I specify my mongodb url, database name in the !connect
>
> Regards,
> Sathish
> 9994152710

Reply via email to