Skip to content

Commit

Permalink
drop example collection after test
Browse files Browse the repository at this point in the history
  • Loading branch information
guileen committed Apr 5, 2012
1 parent 3fa0d3d commit c8a1fa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions examples/insert.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var db = require('./config').db;


db.collection('test').insert({foo: 'bar'}, function(err, result) { db.collection('test').insert({foo: 'bar'}, function(err, result) {
console.log(result); console.log(result);
db.close(function() { db.collection('test').drop();
console.log('connection closed'); db.close();
});
}); });
7 changes: 3 additions & 4 deletions examples/update.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ var articles = db.collection('articles');
articles.insert({foo: 'bar', val: 'val1'}, function(err, result) { articles.insert({foo: 'bar', val: 'val1'}, function(err, result) {


console.log(result); console.log(result);
articles.update({foo:'bar'}, {foo: 'bar', val:'val2'}, function(err, result) { articles.update({foo:'bar'}, {foo: 'bar', val:'val2'}, {safe: true}, function(err, result) {


console.log(result); console.log(result);
articles.find({foo: 'bar'}).toArray(function(err, docs){ articles.find({foo: 'bar'}).toArray(function(err, docs){


console.log(docs); console.log(docs);
db.close(function() { articles.drop();
console.log('connection closed'); db.close();
});


}); });


Expand Down

0 comments on commit c8a1fa7

Please sign in to comment.