Fixed example
This commit is contained in:
parent
3b34578cb6
commit
91b0b9df0e
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ class User extends Model {
|
||||||
Db db = new Db('mongodb://localhost:27017/local');
|
Db db = new Db('mongodb://localhost:27017/local');
|
||||||
await db.open();
|
await db.open();
|
||||||
|
|
||||||
app.use('/api/users', new MongoTypedService<User>());
|
app.use('/api/users', new MongoTypedService<User>(db.collection("users")));
|
||||||
|
|
||||||
app.service('api/users').afterCreated.listen((HookedServiceEvent event) {
|
app.service('api/users').afterCreated.listen((HookedServiceEvent event) {
|
||||||
print("New user: ${event.result}");
|
print("New user: ${event.result}");
|
||||||
|
|
Loading…
Reference in a new issue