Sameesh
Sameesh

Reputation: 353

How to perform a right outer join in Mongo db

I needed to perform a right outer join in Mongo db. I know we can use $lookup to perform left outer join. I needed to know is there any way to perform right outer join in Mongo db?

Upvotes: 0

Views: 7119

Answers (1)

Clement Amarnath
Clement Amarnath

Reputation: 5466

Table A Left Outer Join Table Band Table B Right Outer Join Table A are equivalent in the SQL world only difference you will have is the order of the columns.

Similarly Use $lookup in mongodb which performs a left outer join. Since your requirement is to perform Right Outer Join, reverse the order of the collections.

Upvotes: 4

Related Questions