I have an app that queries a MongoDB database with a text index that has to return objects from multiple collections, just like the Instagram query that looks for people, hashtags or locations at the same time.
I'm looking for a way to have this collections separated normally, but having a single MongoDB index for the 3 collections.
I've been looking for this but all I find is multiple column indexes and compound indexes inside the same collection.
Is this possible to accomplish on MongoDB? Without making another collection to store all objects, I mean...
If not, can I query multiple collections using similar indexes like full-text and geolocated indexes?
MongoDB doesn't provide inter collection communication mostly to maintain high availability and scaling ability. ($lookup is one off exception).
So index spanning different collection? NO, joins on different collection, NO (at least No for healthy use). Triggers? NO (Not yet). Transactions? NO.
It would be a mess if mongoDB is used with RDBMS best practices. learn to denormalize.