Skip to content

Commit

Permalink
Grammar fixes to unique FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
mfluehr authored Nov 16, 2017
1 parent a0ee8d8 commit 2f2782e
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 2f2782e

Please sign in to comment.