How Can I Create Influxdb with Nestjs?
I Am a New Software Developer. I Don't Have Much Software Background, but I'm Trying to Learn as Much as I Can. Is There Anyone Who Has Done Influxdb Operation...
i am a new software developer. I don't have much software background, but I'm trying to learn as much as I can. Is there anyone who has done influxdb operation with nestjs before? If yes, can you share your previous experiences? Thank you in advance for reading and replying.
1 Answer
Your going to face many hardships if you consider using nestjs... Maybe im wrong and your underselling yourself, but if you are asking if its possible to connect a database to your backend then nest is surly going to be WAYYYYY WAYYYYY WAYYYYY to complex -> to be able to figure stuff out... Not that you CANT but you might want to consider
Express first just to get an understanding of how a backend works -> without having to plan out all your dtos' controllers services yatta yatta yatta.. you can do all of the same stuff with express, infact the developers used express to make next -> and then added a whole lot of enterprise level stuff that doesnt come standard with express.
plus if you are new to coding then typescript might be a bit much. very sorry if this was not what you were looking for Im not trying to steer you in any particular direction. but I spend 12 hours - 36 hours sometimes trying to figure things out that I already had working before ... the injection and all that come with nest is good , but if you dont know why you need it , then its going to be very hard to actually learn the concepts.
its alot easier to teach someone how to drink water if theyre thirsty .
otherwise you are just going to spend alot of time that could of went into learning the things that are a prerequisite of nest
strong es6 / ts is def a must
the es6 part is more important imo because dealing with everything async for instance and the way everything is formatted its very confusing without a strong grasp of whats going on behind the scenes.
--- as im sure your going to want to find out the hard way -> and i dont blame you if you can get through it you will be a much stronger person =) but here try this on for size.
import { Module } from "@nestjs/common";
import { InfluxDbModule, InfluxModuleOptions } from "nest-influxdb";
import { UtilsModule } from "./utils/utils.module";
import { ConfigService } from "./utils/config/config.service";
@Module({
imports: [
InfluxDbModule.forRootAsync({
imports: [UtilsModule],
inject: [ConfigService],
useFactory: async (
config_servie: ConfigService
): Promise<InfluxModuleOptions> => {
return {
host: config_servie.get("INFLUX_HOST")
};
}
}),
BlogModule
],
controllers: [AppController],
providers: [AppService]
})
export class AppModule {}
this will go in your root level module file -> then you will use the for feature method for the specific thing inside your root database
check the nest docs for how it works with other databases then try to connect the dots with that above package