問題タブ [mongodb4.0]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
mongodb - 特定のキーフォームの 3 つの異なるコレクションの平均値を取得する
多くのレコードを持つ 3 つのコレクションがあります。それらのそれぞれには、価格、名前などのいくつかのキーがあります...
c
ご覧のとおり、他のコレクションとは異なり、コレクションに提出された価格はdata.detail
フィールドにあります。
に基づいて、そこにあるコレクションの価格の平均を計算したいと考えていname
ます。
最終結果は、計算された価格の製品の配列になるはずです。出来ますか?
私はこれを結果として持ちたい: