Working of OR operator in mongodb with php
$query = array(
'table' => $table,
'user_id' => array('$ne'=> null),
'$or' => array('movies' => array('$ne' => null), 'comics' => array('$ne' => null) )
);
$dbcollection->find($query);
Here I try to return whole records where movies array or comics array is not null, But I always return empty array. In database, movies or comics array is present in some records and some other records no movies or comics array is present.
How can I correct this query ?
mongo) and it will tell you which version you are it. In any case, PHP driver version 1.0.4 is really old. And I don't think MongoDB version 1.0.4 exists. Don't you mean 2.0.4? Also, post a sample document with your question so we can have a look at what is stored.