Created
November 19, 2011 14:09
-
-
Save yssk22/1378865 to your computer and use it in GitHub Desktop.
node-mongodb-native について(エラーがでるコード)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> var server = new (require('mongodb').Server)('localhost', 27017); | |
> var db = new (require('mongodb').Db)('foo', server); | |
> db.open(function(){ | |
... db.collection('foo', function(_, collection){ | |
... collection.insert([{"_id": 'foo'}, {"_id": 'foo'}], {safe:true}, function(e){ console.log(e); }) | |
... }); | |
... }); | |
> { stack: [Getter/Setter], | |
arguments: undefined, | |
type: undefined, | |
message: 'E11000 duplicate key error index: foo.foo.$_id_ dup key: { : "foo" }', | |
name: 'MongoError', | |
err: 'E11000 duplicate key error index: foo.foo.$_id_ dup key: { : "foo" }', | |
code: 11000, | |
n: 0, | |
connectionId: 1, | |
ok: 1 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment