How to INNER JOIN two Objects


I’ve read through the docs but am not able to see how we can “inner join” 2 object stores in a query.

For example, we have 2 independent object stores - DataSets and DataOrders:

DataSets have:
id, colA, colB

DataOrders have:
id, DataSetID, colX, colY

I’d like to write a single query to join DataSets onto DataOrders via the “DataOrder.DataSetID ==”

so I can get a full result set:, colA, colB,, DataSetID, colX, colY

Also - we are using React Moralis -

Any help will be appreciated.


Check this:

Let me know if the docs help you

Thanks @ivan - that worked.

My original question should not have mentioned INNER JOIN as that’s not correct. Should be “how can I JOIN 2 data object collections”

Also for anyone else trying to JOIN on the ID field from one object to another property field of another Object (as per my example above “DataOrder.DataSetID ==”)

You need to use the field “_id” in your pipeline
foreignField: “_id”

Full example here: