Skip to content

Commit 0c49147

Browse files
docs(examples): remove deprecated typegoose arrayProp (#657)
* Removes arrayProp as it is deprecated * Changes items to type * Update mongo connection url variable Co-authored-by: Michał Lytek <michal.wojciech.lytek@gmail.com>
1 parent 3c93010 commit 0c49147

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/typegoose/entities/recipe.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
prop as Property,
3-
arrayProp as ArrayProperty,
43
getModelForClass,
54
} from "@typegoose/typegoose";
65
import { ObjectId } from "mongodb";
@@ -24,7 +23,7 @@ export class Recipe {
2423
description?: string;
2524

2625
@Field(type => [Rate])
27-
@ArrayProperty({ items: Rate, default: [] })
26+
@Property({ type: () => Rate, default: [] })
2827
ratings: Rate[];
2928

3029
@Field(type => User)

examples/typegoose/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ export interface Context {
1616
user: User;
1717
}
1818

19-
// replace with your value if needed
20-
const MONGO_HOST = "192.168.99.100";
19+
// replace with your values if needed
20+
const MONGO_DB_URL = "mongodb://localhost:27017/type-graphql";
2121

2222
async function bootstrap() {
2323
try {
2424
// create mongoose connection
25-
const mongoose = await connect(`mongodb://${MONGO_HOST}:27017/type-graphql`);
25+
const mongoose = await connect(MONGO_DB_URL);
2626

2727
// clean and seed database with some data
2828
await mongoose.connection.db.dropDatabase();

0 commit comments

Comments
 (0)