Martin Thompson
Martin Thompson

Reputation: 3755

How to do recursive CTE ( SQL server Equivalent ) in Mongo DB

Does MongoDB have something similar to what the SQL standard calls recursive CTEs (Common Table Expression)? You can see a SQL Server example of this halfway down this page.

Upvotes: 1

Views: 2042

Answers (2)

th3sly
th3sly

Reputation: 1891

Looks like $graphLookup might be what you're looking for. Check the manual graphLookup

Upvotes: 1

vantian
vantian

Reputation: 888

Possibly duplicate Recursion query?

There's no straight conversion between Relational Model and Document Model. you have to change your table structure.

Upvotes: 0

Related Questions