AustinCodingAcademy / campus-manager

Campus Manager
https://campus.austincodingacademy.com
8 stars 28 forks source link

Multiple textbooks #308

Closed SeanPhilippi closed 5 years ago

SeanPhilippi commented 5 years ago

tested in Robo 3T, works

db.getCollection('courses').find({}).forEach(course => {
  if (course.textbook !== null) {
    db.getCollection('courses').update(
      { "_id": course._id },
      { $set: { "textbooks": [course.textbook] }}
    )
  }
})