How would I find a row with two objects? Example:
$m = new Mongo();
$db = $m->mydb->user_tokens;
$cursor = $db->findOne(array('$and' => array('user_id' => $userid, 'token_id' => $tokenid)));
I’m not sure if you can even do this in PHP. I have a python backend server that I can do something similar to this but need to be able to do it on the frontend as well.
You don’t need the $and qualifier; just setting your two conditions should work fine.
In php one thing I’ve found useful is to take your query; then do a:
This way you can take your query and try it directly on the console to confirm it’s showing what you’re thinking it should.
A bit further into the above explained..
Currently this is what you’re querying on:
I found this out by doing
You want to be doing either:
Useful sheet to look up when creating your queries: