Update mongodb-tests.ts

mongodb-tests.ts
This commit is contained in:
King.W
2017-06-15 19:36:15 +08:00
committed by GitHub
parent a52b00b18b
commit 141e4d6a7b
+1 -1
View File
@@ -85,7 +85,7 @@ let options = {
let cursor: mongodb.Cursor<bag> = collection.find<bag>({color: 'black'})
cursor.toArray(function (err,r) { r[0].cost} );
cursor.forEach(function (bag ) { bag.color }, () => {});
collection.findOne({ color: 'white' }).then(() => { })
collection.findOne({ color: 'white' }).then(b => { let _b:bag = b; })
collection.findOne<bag>({ color: 'white' }).then(b => { b.cost; })
}
{