ipt icon indicating copy to clipboard operation
ipt copied to clipboard

Add MongoDB connector

Open mdoering opened this issue 8 years ago • 6 comments

Allowing the IPT to connect to MongoDB and extract data

mdoering avatar Apr 10 '17 12:04 mdoering

FWIW, KE-EMu is in the midst of migrating its backend to MongoDB. Other backends will be options, but these too will be stored as JSON documents.

dshorthouse avatar Oct 25 '17 14:10 dshorthouse

Thanks @dshorthouse. There are currently 22 other open enhancements and everybody is warmly invited to thumbs up their favorites or comment as you did in order to raise their priority in getting attended to.

kbraak avatar Oct 25 '17 15:10 kbraak

Sadly, it doesn't look like there's a free (& usable) jdbc connector.

  1. https://github.com/erh/mongo-jdbc (no development in 8 years)
  2. http://www.unityjdbc.com/mongojdbc/mongo_jdbc.php ($500 US for client, unknown for server)
  3. https://www.dbschema.com/mongodb-jdbc-driver.html (unknown)

dshorthouse avatar Oct 25 '17 17:10 dshorthouse

It does not have to be JDBC, we also added support for Excel sheets through a custom connector. But I would hope we can get away with the same kind of mapping configurations, otherwise the coding would become a little difficult.

Currently the IPT works by configuring multiple sources that need to expose flat rows with columns. These can then be mapped to the terms and core/extension rowTypes.

As long as we can expose MongoDB in, potentially multiple, flat tables that can be accessed by a column index number we are good.

mdoering avatar Oct 26 '17 08:10 mdoering

getting a list of documents is probably fine, but how can we flatten an arbitrary nested JSON document? Could a source define a list of JSONPath expressions that mongo-java-driver can evaluate and we can then map terms to as the list of json paths is flat and indexable just as row column numbers?

Would you expose all documents or query for a subset?

mdoering avatar Oct 26 '17 08:10 mdoering

Looks like we could use a mongodb projection: https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/#projection

http://mongodb.github.io/mongo-java-driver/3.5/driver/tutorials/perform-read-operations/#projections

mdoering avatar Oct 26 '17 08:10 mdoering