MongoDB sum values in document

MongoDB sum values in document

I'm making an application with MongoDB and C#. I use the MongoDB driver.

I'm making an application with MongoDB and C#. I use the MongoDB driver.

{
     _id: ObjectId("5099803df3f4948bd2f98391"),
     Title: "Test",
     Rating: {
          1234 : 4.0,
          4689 : 2.5,
          1987 : 1.5
     }
}

Now I want to get the average rating. So (4.0+2.5+1.5) / 3. But how do I do this with MongoDB and the C# driver. I'm trying to unwind and then count. But it's not working.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective

Variable Introduction in C#[Bangla]

LIKE | COMMENT | SHARE | SUBSCRIBE A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in C# has a speci...