I have this code which will query data to a MongoDB Collection:
namespace RemoteStaff\Mongo\Resources;
use RemoteStaff\AbstractMongoResource;
use RemoteStaff\Documents\CandidateAsl;
use RemoteStaff\Documents\LanguageObject;
class CandidateAslResource extends AbstractMongoResource
{
public function saveCandidateAsl($params){
$dm = $this->getDocumentManager();
$marlon = $dm->getRepository('RemoteStaff\Documents\CandidateAsl')->findOneBy(["nationality"=>"223756"]);
print_r($marlon);
}
}
How do I query directly to a mongo collection without a model like RemoteStaff\Documents\CandidateAsl
?
The reason I want to do this is because I will do the model later on, as for now I just need to query to a mongo collection, get result without making a document model.
I tried looking http://docs.doctrine-project.org/projects/doctrine-mongodb-odm
but seems I cant find what I need. So basically I need a query something like this I think:
$marlon = $dm->getRepository('my_mongodb_collection_name')->findOneBy(["nationality"=>"223756"]);