Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on 12 Months with MongoDB. Parent comment
From the "Array Element by Position" example:
db.blogposts.find( { "comments.0.by" : "Abe" } )
If you stored XML documents in PostgreSQL the similar query to the MongoDB one would be something like this:
select * from blogposts where (xpath('/comments[0]/@by', doc))::text[] = array['Abe']
There are no comments on this comment yet.
From the "Array Element by Position" example:
PostgreSQL doesn't have JSON support but it does have XML/Xpath support.If you stored XML documents in PostgreSQL the similar query to the MongoDB one would be something like this:
Yes it's a little more verbose but not terrible so... at least in my opinion.