I want to annotate some messages in MongoDB from a social network as spam.
If I use in the query _id
, it works, but not using regular expression.
this works for one record:
db.group_data.update({_id:"gid_91496835_topic_192"},{$set:{SPAM:true}})
this doesn't work for all, but seems to update one record:
db.group_data.update({"text":/.*yburlan.ru.*/},{$set:{SPAM:true}})
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
How can I update
/set
to all records found by regexp?