Skip to content

Commit 400443f

Browse files
Merge pull request #3055 from iamandrewluca/patch-1
fix(mongo): use correct semantics for an array field
2 parents b6dc807 + 6bcdb0a commit 400443f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/techniques/mongo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ In case there are multiple owners, your property configuration should look as fo
8686

8787
```typescript
8888
@Prop({ type: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Owner' }] })
89-
owner: Owner[];
89+
owners: Owner[];
9090
```
9191

9292
Finally, the **raw** schema definition can also be passed to the decorator. This is useful when, for example, a property represents a nested object which is not defined as a class. For this, use the `raw()` function from the `@nestjs/mongoose` package, as follows:

0 commit comments

Comments
 (0)