Latest release of PostgreSQL have capabilities to work like document oriented databases (e.g. MongoDB). There Is promising benchmarks that says postgres x times faster then mongo. Can someone give me advice how to work with postgres as with MongoDB. I'm seeking for step by step simple example concerned on
1) How to create simpliest table that contain JSON/JSONB objects like documents in mongodb
2) How to make search on it at least by id, like I can do in mongodb with collection.find({id: 'objectId'}) for example
3) How to create new object or overwrite existing at least by id, like I can do in mongodb with
collection.update(
{id: objectId},
{$set: someSetObject, $unset: someUnsetObject}
{upsert: true, w: 1}
)
4) How to delete object if it exists at leas by id, like I can do in mongodb with collection.remove({id: 'objectId'})