How many RPUs does it take in MongoDB aggregate, if multiple documents in the collection loopup to a single document in another collection?

How many RPUs does it take in MongoDB aggregation, if multiple documents in the collection loopup to a single document in another collection?

I have a serverless instance in MongoDB Atlas.

I have two collections: Organizations and Users.

Every User is part of one Organization i.e. organizationId is stored in every user document.

Let’s say right now I have only one document in the Organization collection. How many RPUs does it take for the below aggregate?

db.users.aggregate([
      {
        $lookup: {
          from: 'organizations',
          localField: 'organizationId',
          foreignField: '_id',
          as: 'organization',
        },
      },
      {
        $unwind: {
          path: '$organization',
          preserveNullAndEmptyArrays: true,
        }
      }
    ]);

The result of the above query is a list of 100 users.

If each document scan is 1 RPU under 4kb, if there is only a single document in the organization collection and all 100 users are part of it.

1.) If each user lookup is considered.

total RPUs = 100 RPUs (100 user documents) + 100 RPUs(for each lookup in organization) = 200 RPUs

2.) Since there is only one organization.

total RPUs = 100 RPUs (100 user documents) + 1 RPUs = 101 RPUs

Which one is the correct value, is it 200 or 101 RPU?

I don’t believe i’ll be able to advise how much RPU this scenario would generate but I would recommend reading over my response in the following post for more information that may help : Serverless RPU model - #3 by Jason_Tran

In saying so, there’s also a feedback for a Serverless RPU estimator post which you can vote on which I believe would help with your use case noted here.

Regards,
Jason