BSON (Binary JSON) คือรูปแบบไบนารีที่ MongoDB ใช้จัดเก็บ document โดยขยาย JSON ด้วย data type เพิ่มเติม (เช่น date, ObjectId, binary และ number type ที่เหมาะสม) และมีประสิทธิภาพในการจัดเก็บและท่องผ่าน การเข้าใจ BSON type ช่วยให้คุณจัดเก็บข้อมูลได้อย่างถูกต้อง
BSON — JSON ไบนารีที่มี type มากขึ้น
JSON has limited types (string, number, boolean, null, object, array).
BSON adds: ObjectId, Date, Binary, Decimal128, distinct Int/Long/Double, Timestamp, etc.
→ BSON is more efficient (binary, typed, traversable) and richer than plain JSON text.
BSON data type ที่พบบ่อย
{
: (),
: ,
: (),
: (),
: (),
: ,
: ,
: (),
: (, ),
: [, ],
: { : },
:
}
