Update README.md

Correcting typo in 'unique index' example.
pull/2/head
Wolf 12 years ago
parent 829441becb
commit 85422770e0
  1. 2
      README.md

@ -390,7 +390,7 @@ db.ensureIndex({ fieldName: 'somefield', unique: true, sparse: true }, function
// Format of the error message when the unique constraint is not met // Format of the error message when the unique constraint is not met
db.insert({ somefield: 'nedb' }, function (err) { db.insert({ somefield: 'nedb' }, function (err) {
// err is null // err is null
db.insert({ somefiled: 'nedb' }, function (err) { db.insert({ somefield: 'nedb' }, function (err) {
// err is { errorType: 'uniqueViolated' // err is { errorType: 'uniqueViolated'
// , key: 'name' // , key: 'name'
// , message: 'Unique constraint violated for key name' } // , message: 'Unique constraint violated for key name' }

Loading…
Cancel
Save