File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 128128 "metadata" : {},
129129 "source" : [
130130 " ### 1. Fetch books with their associated reviews\n " ,
131- " [Solution here](https://mongodb-developer.github.io/sql-to-query-api-lab/docs/aggregation/lookup#-1-fetch-books-with-their-associated-reviews)"
131+ " \n " ,
132+ " Bonus: try adding a `$limit` stage as an extra improvement to reduce the output size.\n " ,
133+ " \n " ,
134+ " [Solution here](https://mongodb-developer.github.io/sql-to-query-api-lab/docs/aggregation/lookup#-1-fetch-books-with-their-associated-reviews)\n "
132135 ]
133136 },
134137 {
142145 },
143146 "outputs" : [],
144147 "source" : [
145- " // type your code here"
148+ " // TYPE YOUR CODE HERE\n " ,
149+ " \n " ,
150+ " AggregateIterable<Document> result = books.aggregate(\n " ,
151+ " List.of(\n " ,
152+ " <REPLACE_WITH_LOOKUP_STAGE> \n " ,
153+ " )\n " ,
154+ " );\n " ,
155+ " \n " ,
156+ " // Iterate through the results\n " ,
157+ " for (Document doc : result) {\n " ,
158+ " System.out.println(\" book: \" + doc.toJson());\n " ,
159+ " }"
146160 ]
147161 }
148162 ],
You can’t perform that action at this time.
0 commit comments