[TIL] 0727

IT/TIL(Today I Learnt)|2022. 7. 28. 10:09

Today I Learnt 

 

0727 :

 

 

 

MongoDB Triggers

 

MongoDB Triggers are a piece of code that lets you execute server-side logic after the occurrence of a database event, for example, when data is added, updated, or removed. You can use database triggers to create complex data interactions

https://hevodata.com/learn/mongodb-triggers/

 

 

 

Streams,

 

when there is change in db , you can get notified 

(ex,  stock gone 0. -> let seller know )

can use Built-in event emitter class from node js 

 

 

 

https://www.mongodb.com/developer/languages/javascript/nodejs-change-streams-triggers/#create-a-mongodb-atlas-trigger

 

Change Streams & Triggers with Node.js Tutorial | MongoDB

Discover how to react to changes in your MongoDB database using change streams implemented in Node.js and Atlas triggers.

www.mongodb.com

 

 

Ngnix : load balancer ?

 

 

React :

 

components    

 

class / function

class components no one use it anymore...

더보기
import React, { Component } from 'react';
/ state = {
// habits: [
// { id: 1, name: "Reading", count: 0 },
// { id: 2, name: "Coding", count: 0 },
// { id: 3, name: "Leanring", count: 0 },
// ],
// };
 
 

// handleIncrement = (habit) => {
// console.log(" handle increment ", habit);

// const habits = [...this.state.habits];
// const index = habits.indexOf(habit);
// habits[index].count++;
// this.setState({ habits });
// };
 
class ComponentName extends Component {
render() {
return (
<div>
 
</div>
);
}
}

 

export default CompoenentName

instead of using hook ,  use this binding. 

 

반응형

'IT > TIL(Today I Learnt)' 카테고리의 다른 글

[TIL] 0811 호주 개발자  (1) 2022.08.11
[TIL] 0728  (0) 2022.07.28
[TIL] 0726  (2) 2022.07.27
[TIL] 0725 Interview Prep  (0) 2022.07.25
[TIL] 0722  (0) 2022.07.25

댓글()