I'm still new to MongoDB. I see a number of get_*
functions on this page, but I don't see any such functions, which could return 8-bit or 16-bit numbers.
Am I supposed to convert all my numerical data to 32-bit or 64-bit signed integers?
Yes, those are the integral types (and a 128-bit decimal type) you get for data you intend to store in MongoDB, per the BSON specification: http://bsonspec.org/spec.html.
The driver intentionally doesn't offer functions taking other types, since we want you to need to think carefully about how to map your integral types into this more limited space of representations, at the call site.