Sorry but I am new to MongoDB I think I understand the concept of shards, and how data can be distributed across servers via a hashed shard key - however I am then unsure on how you know which shard you are to query.
For example - I have a collection of users, which is sharded, and has an index of _id_hashed (so far so good - nice evenly distributed db of users) I then need to timeout those users who have been inactive for a set time
$c->update(array('session.lastLogged'=>array('$lt'=>$time - ($timeout*60))), array('$set' => array('session'=>'') ));
I get the following error:
For non-multi updates, must have _id or full shard key ({ _id: "hashed" }) in query
However, I do not know the id to query, and the session data will change and so cannot act as the shard key
Is this an issue with the structure of my data or with my query?