3 ms·
Sure, check out: http://www.mongodb.org/display/DOCS/Dot+Notation+%28Reaching+into+Objects%29 http://www.mongodb.org/display/DOCS/Dot+Notation+%28Reaching...
by w1nk 16y ago
Sure, check out:
http://www.mongodb.org/display/DOCS/Dot+Notation+%28Reaching+into+Objects%29 http://www.mongodb.org/display/DOCS/Dot+Notation+%28Reaching...
- lneves 16y agoI do not think that this is equivalent, it looks like querying complex JSON objects and not "simple" arrays. From the "Array Element by Position" example: db.blogposts.find( { "comments.0.by" : "Abe" } ) 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: select * from blogposts where (xpath('/comments[0]/@by', doc))::text[] = array['Abe'] Yes it's a little more verbose but not terrible so... at least in my opinion.