Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete data from a collection in mongo db by using multiple conditions

Tags:

mongodb

I am new to mongo db using i have to delete data from a table like

select from table where id=12 and browser =GC

But I dont know how to perform this in mongo db?

like image 453
Sush Avatar asked Dec 09 '22 10:12

Sush


1 Answers

Use remove

db.collectionName.remove({'_id':12,'browser':"GC"})

Can provide more accurate answer if you show your collection and documents .

like image 65
DhruvPathak Avatar answered Jan 18 '23 11:01

DhruvPathak