Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Completed
Categories Atlas Search
Created by Guest
Created on Oct 3, 2019

Perform a search over multiple collections

Right now you can only search over one collection. I'd like to be able to search over several collections at the same time.
  • ADMIN RESPONSE
    Oct 18, 2025
    Leverage $unionWith and $lookup to run search queries against multiple collections or create a materialized view prior to indexing. View tutorials here. ( https://www.mongodb.com/docs/atlas/atlas-search/tutorial/cross-collection-tutorials/ )
  • Guest
    Oct 13, 2020
    Starting in MongoDB 4.2, you can search over multiple collections with materialized views. For some use cases that is not idea, but for many it should work just fine. If it won't work in your case, please let us know why it would not.
  • Guest
    Nov 8, 2019
    i want to use searchBeta operator on dbref objects attribute how i can give instructions to analyzer to access fields from reference object and do indexing For example, assuming the following two collections: Collection1 { _id: ObjectId("5d636ff2259c5a0b3c83d2f1"), name: "This", something: "Else", emp: ObjectId("5d639e2af8e23f1fb0921032") } Collection2 { _id: ObjectId("5d639e2af8e23f1fb0921032"), name: "ABC" salary: 1000 } I want to be able to run a query like the following: db.Collection1.aggregate([ { $searchBeta: { "term": { "query": "ABC", "path": "emp.name" } } } ])