MongoDB 3.x stores binary data in a way that is not base64, although the query results in the MONGO client are displayed in base64 manner, please feel free to use. The following analysis stores the contents of the stored file. Base64 encoded data will grow by 1/3 as a concern.
First, look at MONGO's c-driver definition of binary type data. Note the following refers to JS, to be clear that the official offer to our mongo-client is the use of JS language.
Below I will save a picture, the picture of the hexdump as below
After inserting the data into the MONGO, the Mongo-client query is displayed as follows, our picture data is displayed as Base64 content, but do not panic, this is the JS language display, not the actual underlying storage.
Finally we look at the physical storage of this record
The conclusion is that MongoDB is actually storing binary data in binary way. Base64 encoded data will increase by 1/3 of the concerns can be waived.
MongoDB Stores binary data