Change stream pipeline on nested fields

Really thanks for your response it’s work

here the code :

    const bankFields = ['bank', 'iban', 'rib', 'bic'];
    const pipeline = [
      {
        $match: {
          operationType: 'update',
          $expr: {
            $or: bankFields.map((field: string) => ({
              $ne: [
                {
                  $type: {
                    $getField: {
                      field: `enterprise.${field}`,
                      input: '$updateDescription.updatedFields',
                    },
                  },
                },
                'missing',
              ],
            })),
          },
        },
      },
    ];
1 Like