I have such MongoDB Collection:
{
date: date,
domain: domain,
visitors: [ {owner:owner, ip:ip, views:views} ]
}
Now I want to check where date equals date AND domain equals domain it should delete the whole visitors array, e.g.:
collection.update({"date":date, {"domain":domain} {"$pull":{"visitors"}} )
How to make this work?
See Question&Answers more detail:os