Preheat oven to 350 degrees F.
Prepare 2 baking sheets with silpat or parchment paper
In a large saute pan over medium heat, heat olive oil until shimmering.
Add onions and reserved mushroom stems, and sauté 3-4 minutes until onions soften.
Add garlic and spinach, and continue to stir, just until spinach wilts, 2-3 minutes.
Remove from heat.
In a food processor fitted with a blade, pulse ricotta, eggs, gorgonzola and spices, just until mixed.
Add spinach mixture and basil and pulse an addition 3 or 4 pulses, or until blended.
Spoon spinach mixture into mushroom caps or portabellos.
Bake at 350 degrees F. for about 30 minutes for caps and 40 minutes for portobellos. Remove mushroom caps and sprinkle with parmesan cheese. Return to oven and bake an additional 5 minutes or until cheese melts.
Makes about 2 dozen mushroom caps