// 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: "online", quantityInStock: 10 },
  { 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: "Pat", lastName: "Senza", email: "Pat.S@gmail.com", phoneNo: "0821234567" },
  { memberID: "M002", firstName: "David", lastName: "Smith", email: david@gmail.com, 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
  }
]);console.log("Hello world!");db.book.find(
  { publicationYear: { $gt: 2026 } }
);

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: