티스토리 뷰

NoSQL/MongoDB

delete document : 문서 삭제

xoo | 수진 2023. 10. 6. 13:34

https://www.mongodb.com/docs/v4.4/crud/#delete-operations

 

MongoDB CRUD Operations — MongoDB Manual

Docs Home → MongoDB Manual CRUD operations create, read, update, and delete documents.You can connect with driver methods and perform CRUD operations for deployments hosted in the following environments:MongoDB Atlas: The fully managed service for MongoD

www.mongodb.com

 


 

단일 문서 삭제 ( deleteOne(필터) )

db.컬렉션.deleteOne(필터)

>db.inventory.deleteOne({item:’paper’})

 

 

 

멀티 문서 삭제 ( deleteMany(필터) )

db.컬렉션.deleteMany(필터)

>db.inventory.deleteMany({qty:{$lt:50}})

'NoSQL > MongoDB' 카테고리의 다른 글

update document : 문서 수정  (0) 2023.10.06
insert document : 문서 저장  (0) 2023.10.05
limit (n), skip(n), sort({key:1}) 1: 오름차순, -1: 내림차순  (1) 2023.10.05
embedded document (중첩 JSON)  (0) 2023.10.05
배열 조회  (0) 2023.10.02
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함