4 ms·
This seems cool, but does anybody know about possibility of using mongo query language with Relational Databases?
by mkrn 12y ago
This seems cool, but does anybody know about possibility of using mongo query language with Relational Databases?
- Jgrubb 12y agoI have absolutely no idea what I'm talking about, but maybe a Postgres extension could be written for this? There's one for running SQL Server T-SQL in Postgres, which is absolutely nothing like Mongo, but...
- s_kilk 12y agoThis would probably be the right way to go. I even started working on a solution last year (see other comment), but got side-tracked by real-life issues. My idea was to write a PG extension which would handle all the smarts, and expose a set of sql functions which could be called from the application side. Those functions could then be wrapped in nice client libraries to give a consistent mongo-a-like interface across languages, with the client doing the bare-minimum to shuttle data to and from the database server.
- s_kilk 12y agoIt's probably just a matter of writing some code to map from mongo-style queries to SQL. The query operations would probably be straight-forward, but I could see issues with the write operators mongo has. For instance, if the relational database doesn't support atomic updates within json documents then it may be hard to match the meaning of mongos $set operation, etc. EDIT: I tried doing exactly this as a clojure library (https://github.com/ShaneKilkelly/clj-bedquilt https://github.com/ShaneKilkelly/clj-bedquilt)
- wilsonfiifi 12y agoThere's a proof of concept here using postgresql https://github.com/JerrySievert/mongolike https://github.com/JerrySievert/mongolike
- ahachete 12y agoI have commented it above, but have you checked ToroDB? ;) https://github.com/torodb/torodb/ https://github.com/torodb/torodb/
- mkrn 12y agoI like where this is going, will be definitely watching this. For my purposes I'm pretty much sure we will be looking for something on top of Postgres. Thanks