Last active
April 20, 2019 06:15
-
-
Save Oscar-zw/4c7261da73a86ed3900aedd115824398 to your computer and use it in GitHub Desktop.
agregamos el schema en el modulo fruit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module } from '@nestjs/common'; | |
import { FruitsController } from './fruits.controller'; | |
import { FruitsService } from './fruits.service'; | |
//importamos nuestro schema | |
import { FruitSchema } from './schemas/fruit.schema'; | |
import { MongooseModule } from '@nestjs/mongoose'; | |
@Module({ | |
//agregamos imports como un array | |
imports:[ | |
// importamos MongooseModule | |
MongooseModule.forFeature([ | |
//agregamos nuestro schema | |
{name: "Fruit", schema: FruitSchema} | |
]) ], | |
controllers: [FruitsController], | |
providers: [FruitsService] | |
}) | |
export class FruitsModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment