Skip to content

Commit

Permalink
Merge pull request #5823 from mfluehr/patch-1
Browse files Browse the repository at this point in the history
Grammar fixes to `unique` FAQ
  • Loading branch information
vkarpov15 committed Nov 16, 2017
2 parents a813dd2 + 2f2782e commit f6960da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/faq.jade
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ block content
:markdown
**Q**. I declared a schema property as `unique` but I can still save duplicates. What gives?

**A**. Mongoose doesn't handle `unique` on it's own, `{ name: { type: String, unique: true } }`
just a shorthand for creating a [MongoDB unique index on `name`](https://docs.mongodb.com/manual/core/index-unique/).
**A**. Mongoose doesn't handle `unique` on its own: `{ name: { type: String, unique: true } }`
is just a shorthand for creating a [MongoDB unique index on `name`](https://docs.mongodb.com/manual/core/index-unique/).
For example, if MongoDB doesn't already have a unique index on `name`, the below code will not error despite the fact that `unique` is true.
:js
var schema = new mongoose.Schema({
Expand Down

0 comments on commit f6960da

Please sign in to comment.