// AUTHOR
db.author.insertMany([
{ authorID: "A001", firstName: "Steve", lastName: "Shakaman" },
{ authorID: "A002", firstName: "Lerato", lastName: "Jonasi" }
]);
// BOOK
db.book.insertMany([
{ ISBN: "9780435905255", title: "Database systems", publicationYear: 2024, availability: "In Store", quantityInStock: 5 },
{ ISBN: "9780399588174", title: "Inroduction to programming", publicationYear: 2027, availability: "Online", quantityInStock: 8 }
]);
// BOOKAUTHOR (bridging entity: book <-> author)
db.bookauthor.insertMany([
{ ISBN: "9780435905255", authorID: "A001" },
{ ISBN: "9780399588174", authorID: "A002" }
]);
// MEMBER
db.member.insertMany([
{ memberID: "M001", firstName: "Thato", lastName: "Senza", email: "thato@gmail.com", phoneNo: "0821234567" },
{ memberID: "M002", firstName: "David", lastName: "Smith", email: null, phoneNo: null }
]);
// BORROWEDBOOKS (bridging entity: member <-> book)
db.borrowedbooks.insertMany([
{
memberID: "M001",
ISBN: "9780399588174",
dateBorrowed: new Date("2026-06-01"),
dueDate: new Date("2026-06-15"),
returnDate: new Date("2026-06-20"),
fineAmount: 50
},
{
memberID: "M002",
ISBN: "9780435905255",
dateBorrowed: new Date("2026-06-10"),
dueDate: new Date("2026-06-24"),
returnDate: null,
fineAmount: 0
}
]);db.students.insertMany([
{ id: 1, name: 'Ryan', gender: 'M' },
{ id: 2, name: 'Joanna', gender: 'F' }
]);
db.students.find({ gender: 'F' });
To embed this project on your website, copy the following code and paste it into your website's HTML: