-
Notifications
You must be signed in to change notification settings - Fork 26
DOCSP-40066: Support SelectMany inside Project/Select #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
7d80701
5c1e041
64f2424
ae46a12
fdfd82e
d68c200
b44d937
f2b28a1
ac5499d
53cfcd3
b5b5962
2b486b2
d5bc23a
6d4c117
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -320,6 +320,90 @@ following documents: | |||||||||
| { "date" : ISODate("2012-12-05T00:00:00Z"), "grade" : "A", "score" : 13 } | ||||||||||
| { "date" : ISODate("2012-05-17T00:00:00Z"), "grade" : "A", "score" : 11 } | ||||||||||
|
|
||||||||||
| Nested Statements | ||||||||||
| +++++++++++++++++ | ||||||||||
|
|
||||||||||
| You can chain or nest ``Select`` and ``SelectMany`` statements to unwind nested | ||||||||||
| arrays. Consider a collection that contains documents with a **new** schema. These | ||||||||||
| documents contain a ``restaurants`` field, which holds an array of documents | ||||||||||
| that each represent the ``Restaurant`` class. The documents within the array each have | ||||||||||
| a ``grades`` field that holds an array of documents that each represent | ||||||||||
| the ``Grade`` class. The following code is an example of a single document in | ||||||||||
|
||||||||||
| a ``grades`` field that holds an array of documents that each represent | |
| the ``Grade`` class. The following code is an example of a single document in | |
| a ``grades`` field that holds an array of documents represented by | |
| the ``Grade`` class. The following code is an example of a single document in |
norareidy marked this conversation as resolved.
Show resolved
Hide resolved
norareidy marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: should this be the first restaurant instead? since these are just the grades for Tov Kosher Kitchen, but the first guidebook document would have more restaurants
| // output for first document in collection | |
| // output for first restaurant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it should be first document - I will make the example/output more clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: since the classes model the documents, I think it's more accurate to say the document is "represented by" Restaurants, rather than represent Restaurants