Skip to content

Instantly share code, notes, and snippets.

@jaimemin
Created July 14, 2025 15:12
Show Gist options
  • Select an option

  • Save jaimemin/c806f7cf510b91e00af0610db8c84f8d to your computer and use it in GitHub Desktop.

Select an option

Save jaimemin/c806f7cf510b91e00af0610db8c84f8d to your computer and use it in GitHub Desktop.
// tags 배열 필드와 rating 필드를 포함하는 문서 컬렉션에서 복합 다중 키 인덱스를 생성
// 태그는 배열 형태의 데이터이고, 평점은 단일 숫자 값을 가지는 필드
db.collection.createIndex({ "tags": 1, "rating": -1 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment