MongoDB: cross-collection queries

Phani

New Member
Assuming a setup like this:\[code\]blogposts{ title:"Example", slug:"example-post" tags: ["foo", "bar"]},{ title:"Example2", slug:"example2" tags: ["foo"]}news{ headline: "Test" slug: "test-news" tags: ["bar"]}\[/code\]I know I can get all the blog posts with a specific tag:\[code\]$cursor = $blogposts->find(array('tags' => 'bar'));\[/code\]but is there any way to query multiple collections at once in order to get all documents with the tag? E.g. to show all content with the tag 'bar'.
 
Back
Top