2014-07-01 86 views
2

在MongoDB中我不得不放棄或WHERE子句MongoDB的多重條件在WHERE子句

我是初學者條件。我不知道如何實現這個目標?

DELETE FROM tablename WHERE id = 6 OR id =8 

什麼是在MongoDB中的類似查詢?

+1

您是否試過閱讀...文檔? – Sammaye

+1

Google是你的朋友:http://docs.mongodb.org/manual/reference/sql-comparison/ –

回答

3

只需使用$或操作符here即可。

db.tablename.remove({ $or: [ { _id: 6 }, { _id: 8 } ] }) 

您也可以在手冊中找到SQL comparison的相應章節。