Do nested values work only with one document? Or it is possible to take 2 fields from all the documents of the collection?
A document can have multiple embedded/nested documents. However, you have to ensure that the resulting document should be within the BSON Document Size limit.
Please refer the following doc for more information on embedded documents:
I hope it answers your query. If you have any doubts, please let me know.
Thanks,
Sonali
Thank you for your answer.