Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Chapter08/01_mongodb_basics/01_mongo_basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ async.waterfall([
// 2. create collections for our albums and photos
function (cb) {
console.log("\n** 2. create albums and photos collections.");
db.collection("albums", cb);
db.createCollection("albums", cb);
},

function (albums_coll, cb) {
albums = albums_coll;
db.collection("photos", cb);
db.createCollection("photos", cb);
},

// 3. verify that creating a new album w same name errors out
function (photos_coll, cb) {
console.log("\n** 3. verify can't re-create collection if strict.");
photos = photos_coll;
db.collection("albums", {strict: true}, function (err, results) {
db.createCollection("albums", {strict: true}, function (err, results) {
if (err) {
console.log(JSON.stringify(err, 0, 2));
console.log("Got EXPECTED error re-creating albums.");
Expand Down
4 changes: 2 additions & 2 deletions Chapter08/02_create_album/app/data/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ exports.init = function (callback) {
// they already exist, then we're good.
function (cb) {
console.log("** 2. create albums and photos collections.");
db.collection("albums", cb);
db.createCollection("albums", cb);
},

function (albums_coll, cb) {
exports.albums = albums_coll;
db.collection("photos", cb);
db.createCollection("photos", cb);
},

function (photos_coll, cb) {
Expand Down