I have a collection of documents by type:
{fields:{_id:1, f1:10, f2:"репа", f3:200}, computedFields:{id:1}}, {fields:{_id:2, f1:10, f2:"репа", f3:200}, computedFields:{id:2}}, ... Inside the cursor (pipeline) I need to convert each document to the form:
{_id:1, f1:10, f2:"репа", f3:200, id:1}, {_id:2, f1:10, f2:"репа", f3:200, id:2}, ... Those. need to get rid of the top level, leaving the bottom
Please tell me how to do it.
mapReducebecause you do not know the name of all the fields. - styvane