There are all of the DB Schemas from this API version. You can go back here.
You can see a the logical schema of the DB in the image below.
- The fields
_id
and__v
are assigned by MongoDB, the client can't change it. - the
config
field is reserved for the client. Use an unique id for each front-end.{ "official-client": {...} }
- Any
ObjectId
with a different key than_id
represents a relation with other document.
{
"_id": ObjectID, // Assigned by MongoDB
"username": String,
"password": String,
"tasksCompleted": [ObjectID],
"courses": [{ "_id": ObjectID, "isAdmin": Boolean }],
"config": { <client>: {}, <client>: {}, ... }, // Any JSON, the server wont validate a format, you can put anything you need.
}
{
"_id": ObjectID, // Assigned by MongoDB
"classcode": String,
"password": String
}
{
"_id": ObjectID, // Assigned by MongoDB
"course": ObjectID,
"name": String,
"teacherName": String,
"teacherEmail": String,
"links": [String]
}
{
"_id": ObjectID, // Assigned by MongoDB
"subject": ObjectID,
"open": Date,
"close": Date,
"name": String,
"description": String,
"links": [String]
}
- The
starts
andends
fields only needs the time value, the day part of the date will be ignored.
{
"_id": ObjectID, // Assigned by MongoDB
"subject": ObjectID,
"starts": Date,
"ends": Date,
"classroom": String,
"links": [String]
}