How can I filter metadata on missing metadata fields

How can I filter the metadata on missing fields in the json?
For example if I have two vectors with metadata of
{ A: 1, B:2 }
{ A: 2 }

How can I filter so that I pick up that the second item is missing the B field? I’ve tried a filter something like:
{ “B”: { “$gte”: 0 } }
but this seems to pick up all items with missing B fields also.