Reading BSON structure
A BSON document begins with its total byte length and then stores a sequence of typed elements terminated by a zero byte. Each element carries a type code, a null-terminated field name, and type-specific bytes. The viewer interprets that structure to separate fields, nested documents, arrays, strings, numbers, binary values, and other BSON types.