Update the key data type from string to int64

The field tagSerialNumbers in the document you shared is an array. That is why you get

You have to $map tagSerialNumbers and convert with { $toLong : $$this }.