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
xoo | 수진