Skip to content

Instantly share code, notes, and snippets.

@Oscar-zw
Last active April 20, 2019 06:15
Show Gist options
  • Save Oscar-zw/4c7261da73a86ed3900aedd115824398 to your computer and use it in GitHub Desktop.
Save Oscar-zw/4c7261da73a86ed3900aedd115824398 to your computer and use it in GitHub Desktop.
agregamos el schema en el modulo fruit
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