SMALL

Sub CrtSheet()

'Updated by ExtendOffice 20181009

    Dim xName As String

    Dim xSht As Object

    On Error Resume Next

    xName = InputBox("Please enter a name for this new sheet ", "Kutools for Excel")

    If xName = "" Then Exit Sub

        Set xSht = Sheets(xName)

        If Not xSht Is Nothing Then

            MsgBox "Sheet cannot be created as there is already a worksheet with the same name in this workbook"

            Exit Sub

            End If

            Sheets.Add(, Sheets(Sheets.count)).Name = xName

        End Sub

알림창 없이 추가시에는 아래처럼

Sub CrtSheet2()

            Sheets.Add(, Sheets(Sheets.count)).Name = "시트이름"

        End Sub

 

LIST
블로그 이미지

SeoHW

,
SMALL

오늘은 vue 인스턴스의 라이프 사이클에 대해 공부해보도록 하겠습니다.

인스턴스의 라이프 사이클을 알면 app을 보다 디테일하게 다룰 수 있습니다.

때문에 반드시 알아야 합니다.

 

vue 인스턴스의 라이프사이클은

beforecreate() 인스턴스가 생성되기 전이다.->

created() 인스턴스가 생성되어 데이터를 사용할 수 있습니다.->

beforeMount() div태그 #app의 html 코드가 생성되기 전 상태->

mount()html코드가 div태그 #app에 html코드가 찍혀있는 상태->

beforeupdate() 데이터가 업데이트 되기 전->

updated()되고난후->

beforedestroy()해당 페이지를 종료하기 전->

destroy() 해당 페이지가 종료된 상태

<template>
  <div>
    <h1>this is Home page</h1>
    <p>{{names}}</p>
    <button v-on:click="dateupdate()">click</button>
  </div>
</template>

<script>
export default{
  data(){
   return{
     names:"balmostory"
    }
  },
  beforeCreate(){
    console.log("beforeCreate",this.names)
  },
  created(){
    console.log("created",this.names)
  },
  beforeMount(){
    alert("beforeMount")
  }
  ,
  mounted(){
    alert("mounted")
  },
  beforeUpdate(){
    alert("beforeUpdate")
  },
  updated(){
    alert("updated")
  },
  beforeDestroy(){
    alert("beforeDestroy")
  },
  destroyed(){
    alert("destroyed")
  },
  methods:{
    dateupdate(){
      this.names="hihihi";
    }
  }
}
</script>


<style scoped>
h1{
  color: red;
  font-size: 20px;
}
</style>

펌 https://balmostory.tistory.com/13

LIST
블로그 이미지

SeoHW

,
SMALL

Mongo DB 에서 사용 할 수 있는 쿼리 옵션에 대해 알아본다.

 

lt 는 미만이다.

 

db.nettuts.find( { "age" : { "$lt" : 40 } } );

 

이렇게 쿼리를 보내면 age가 40 미만인 것을 가져온다.

 

 

lte 는 이하 이다.

 

db.nettuts.find( { "age" : { "$lte" : 40 } } );

 

이렇게 쿼리를 보내면 age 가 40 이하인 것을 가져온다.

 

 

gt는 초과 이다.

 

db.nettuts.find( { 'age' : { '$gt' : 47 } } );

 

이렇게 쿼리를 보내면 age 가 47 초과하는 것을 가져온다.

 

 

gte는 이상이다.

 

db.nettuts.find( { 'age' : { '$gte' : 47 } } );

 

이렇게 쿼리를 보내면 age 가 47 이상인 것을 가져온다.

 

 

in은 특정 key의 값이 ㅁㅁㅁ인 경우에 사용한다.

 

db.nettuts.find( { 'occupation' : { '$in' : [ "actor", "developer" ] } }, { "first" : 1, "last" : 1 } );

 

이렇게 사용한다. 이렇게 쿼리를 작성하면 occupation 이 actor이거나 developer인 것을 가져온다.

 

first 와 last 에 각각 1이 있으므로 오름차순으로 정렬한다.

 

nin 은 in과 반대로 동작한다.

 

occupation 이 actor도 아니고 developer도 아닌 것을 가져온다.

 

not 을 알아보자. not 은 부정 연산자이다.

 

db.nettuts.find( { 'occupation' : { '$not' : [ "actor", "developer" ] } }, { "first" : 1, "last" : 1 } );

 

not 뒤의 조건이 아닌 경우를 찾는다.

 

 

정규표현식

 

db.nettuts.find( { "first" : /(ma|to)*/i, "last" : /(se|de)/i  } );

 

이렇게 쿼리를 작성하면 first가 ma 또는 to 로 시작하는 것을 가져온다.

 

그리고 last 가 se 또는 de로 시작하는 것도 가져온다.

 

특정 문자를 포함하는 결과를 모두 가져오려면 이렇게 하면 된다.

 

db.nettuts.find( { "first" : { $regex : /(ma)/ } } );

 

이렇게 하면 ma가 앞뒤로 포함된 모든 결과를 가져온다.



출처: https://fors.tistory.com/403 [Code]

LIST

'mongoDB' 카테고리의 다른 글

node js 에서 mongodb 필드추가  (0) 2021.10.19
블로그 이미지

SeoHW

,