Skip to content

Commit

Permalink
Merge pull request #5927 from abagh0703/patch-1
Browse files Browse the repository at this point in the history
Grammar change: it's --> its
  • Loading branch information
vkarpov15 committed Dec 25, 2017
2 parents f59defb + a159115 commit 6da0c52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/2.7.x/docs/populate.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h1>Populate - DBRef-like behavior</h1>
var Person = mongoose.model('Person', PersonSchema);
</code></pre>

<p>So far we've created two models. Our <code>Person</code> model has it's <code>stories</code> field set to an array of <code>ObjectId</code>s. The <code>ref</code> option is what tells Mongoose in which model to look, in our case the <code>Story</code> model. All <code>_id</code>s we store here must be document <code>_id</code>s from the <code>Story</code> model. We also added a <code>_creator</code> <code>ObjectId</code> to our <code>Story</code> schema which refers to a single <code>Person</code>.</p>
<p>So far we've created two models. Our <code>Person</code> model has its <code>stories</code> field set to an array of <code>ObjectId</code>s. The <code>ref</code> option is what tells Mongoose in which model to look, in our case the <code>Story</code> model. All <code>_id</code>s we store here must be document <code>_id</code>s from the <code>Story</code> model. We also added a <code>_creator</code> <code>ObjectId</code> to our <code>Story</code> schema which refers to a single <code>Person</code>.</p>

<h2>Saving a ref (to the parent)</h2>

Expand Down

0 comments on commit 6da0c52

Please sign in to comment.