Skip to Content
몽고DB 완벽 가이드(3판): 실전 예제로 배우는 NoSQL 데이터베이스 기초부터 활용까지
book

몽고DB 완벽 가이드(3판): 실전 예제로 배우는 NoSQL 데이터베이스 기초부터 활용까지

by 김인범, 크리스티나 초도로우, 섀넌 브래드쇼, 오언 브라질
March 2021
Beginner to intermediate
600 pages
12h 19m
Korean
Hanbit Media, Inc.
Content preview from 몽고DB 완벽 가이드(3판): 실전 예제로 배우는 NoSQL 데이터베이스 기초부터 활용까지
68
1
몽고DB 시작
{ "_id" : 5, "title" : "Scarface", "year" : 1983 }
> db.movies.deleteMany({})
{ "acknowledged" : true, "deletedCount" : 5 }
> db.movies.find()
일반적으로 도큐먼트를 제거하는 작업은 꽤 빠르다. 그러나 전체 컬렉션을 삭제하려면 다음과
같이
drop
을 사용하는 편이 더 빠르다.
> db.movies.drop()
true
그리고 빈 컬렉션에 인덱스를 재생성한다.
데이터는 한 번 제거하면 영원히 사라진다. 이전에 백업된 데이터를 복원하는 방법 외에
delete
또는
drop
작업을 취소하거나 삭제된 도큐먼트를 복구하는 방법은 없다. 몽고
DB
업 및 복원에 대한 자세한 내용은
23
장을 참조하자.
3.3
도큐먼트 갱신
도큐먼트를 데이터베이스에 저장한 후에는
updateOne
,
updateMany
,
replaceOne
과 같은 갱
신 메서드를 사용해 변경한다.
updateOne
updateMany
는 필터 도큐먼트를 첫 번째 매개변
수로, 변경 사항을 설명하는 수정자 도큐먼트
modifier
document
를 두 번째 매개변수로 사용한다.
replaceOne
도 첫 번째 매개변수로 필터를 사용하지만 두 번째 매개변수는 필터와 일치하는
도큐먼트를 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발

풀스택 서버리스: 리액트, AWS, 그래프QL을 이용한 최신 애플리케이션 개발

김범준, 네이더 다빗

Publisher Resources

ISBN: 9791162244067