Tsallaka zuwa abun ciki
Justice Tech School

BSON Data Types

Documents are stored as BSON, which adds types to JSON: string, int, long, double, decimal, boolean, date, ObjectId, array, object and null.

Example
{
  name: "Ada",
  age: NumberInt(30),
  balance: Decimal128("19.99"),
  joined: new Date("2024-01-15"),
  active: true
}

Exercise

Date type.

new ("2024-01-15")

Quiz Test

Which type is best for money?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.