File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ const commentSchema = new Schema({
563
563
doc: {
564
564
type: Schema .Types .ObjectId ,
565
565
required: true ,
566
- refPath : () => {
566
+ refPath : function () {
567
567
return this .docModel ; // 'this' refers to the document being populated
568
568
}
569
569
},
@@ -605,7 +605,7 @@ regardless of how many models your `commentSchema` can point to.
605
605
606
606
<h2 id =" dynamic-ref " ><a href =" #dynamic-ref " >Dynamic References via <code >ref</code ></a ></h2 >
607
607
608
- Just like ` refPath ` , ` ref ` can also be assigned a function
608
+ Just like ` refPath ` , ` ref ` can also be assigned a function.
609
609
610
610
``` javascript
611
611
const commentSchema = new Schema ({
@@ -614,7 +614,7 @@ const commentSchema = new Schema({
614
614
doc: {
615
615
type: Schema .Types .ObjectId ,
616
616
required: true ,
617
- ref : () => {
617
+ ref : function () {
618
618
return this .verifiedBuyer ? ' Product' : ' BlogPost' ; // 'this' refers to the document being populated
619
619
}
620
620
},
You can’t perform that action at this time.
0 commit comments