Browse files

drop example collection after test

  • Loading branch information...
1 parent 3fa0d3d commit c8a1fa7c1001669b6144f55795365351e0f3d8d3 @guileen committed Apr 5, 2012
Showing with 6 additions and 7 deletions.
  1. +3 −3 examples/insert.js
  2. +3 −4 examples/update.js
View
6 examples/insert.js
@@ -2,7 +2,7 @@ var db = require('./config').db;
db.collection('test').insert({foo: 'bar'}, function(err, result) {
console.log(result);
- db.close(function() {
- console.log('connection closed');
- });
+ db.collection('test').drop();
+ db.close();
+
});
View
7 examples/update.js
@@ -3,15 +3,14 @@ var articles = db.collection('articles');
articles.insert({foo: 'bar', val: 'val1'}, function(err, 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);
articles.find({foo: 'bar'}).toArray(function(err, docs){
console.log(docs);
- db.close(function() {
- console.log('connection closed');
- });
+ articles.drop();
+ db.close();
});

0 comments on commit c8a1fa7

Please sign in to comment.