4 ms·
One viable option: CREATE TABLE mongodb ( key VARCHAR(256) PRIMARY KEY, value JSON );
by yummyfajitas 13y ago
One viable option:
CREATE TABLE mongodb (
key VARCHAR(256) PRIMARY KEY,
value JSON
);
- mkhattab 13y agoI think you're onto something here.
- joevandyk 13y agoI'd use a uuid for the key. Also, see https://github.com/umitanuki/mongres https://github.com/umitanuki/mongres Postgresql speaking the mongodb protocol.
- tzury 13y agofrom the github page mentioned above: This is currently a prototype. The following operations are supported. db.collection.find() db.collection.insert() Two methods only, well, that's too little.
- meowface 13y agoMongo (and other document stores) let you do pretty complex querying within JSON objects. Postgres unfortunately doesn't let you do so; that's really the only thing keeping me with Mongo at the moment.
- yummyfajitas 13y agoIt does with plv8. Just like in mongodb, you get to write javascript functions and use them for queries. https://postgres.heroku.com/blog/past/2013/6/5/javascript_in_your_postgres/ https://postgres.heroku.com/blog/past/2013/6/5/javascript_in... I don't know how stable/performant it is (I've never needed to use it), however...
- joevandyk 13y agoPostgresql 9.3 added json functions.