This will be an expensive operation. Essentially, for each document in A, you will need to read each document in B, and compare every field and every value of every field.
If you have a compound index on the fields you want to compare, you could use $lookup with multiple join conditions:
db.a.aggregate([
{ $lookup:
{ from: "b",
let: {"subjectId": "$subjectId", "sex": "$sex", "ageBracket": "$ageBracket"},
pipeline: [
{$match:
{$expr:
{$and:
[ {$eq: ["$subjectId", "$$subjectId"],
{$eq: ["$sex", "$$sex"],
...
} ])