Converter from QJsonDocument to BSON format