diff options
author | 2023-09-10 05:05:13 +0300 | |
---|---|---|
committer | 2023-09-09 19:05:13 -0700 | |
commit | 6fe40f383af230ffade0a764bf25cbdb655db2af (patch) | |
tree | 7683ab599ba8d495e04c8e896ab373883157a1a8 | |
parent | e2d327881c5bd92ab06f5b6fd6d7b501459e05f9 (diff) | |
download | bun-6fe40f383af230ffade0a764bf25cbdb655db2af.tar.gz bun-6fe40f383af230ffade0a764bf25cbdb655db2af.tar.zst bun-6fe40f383af230ffade0a764bf25cbdb655db2af.zip |
Fix mongoose ecosystem guid (#4740)
Fix missing method declaration on schema and Schema database name from Kitten to Animal
-rw-r--r-- | docs/guides/ecosystem/mongoose.md | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/guides/ecosystem/mongoose.md b/docs/guides/ecosystem/mongoose.md index a36bcd134..043ec4f22 100644 --- a/docs/guides/ecosystem/mongoose.md +++ b/docs/guides/ecosystem/mongoose.md @@ -33,11 +33,18 @@ const animalSchema = new mongoose.Schema( { name: {type: String, required: true}, sound: {type: String, required: true}, + }, + { + methods: { + speak() { + console.log(`${this.sound}!`); + }, + }, } ); export type Animal = mongoose.InferSchemaType<typeof animalSchema>; -export const Animal = mongoose.model('Kitten', animalSchema); +export const Animal = mongoose.model('Animal', animalSchema); ``` --- |