Closed wmendes closed 10 years ago
Sorry guys, solved!
The correct sintax is: $threads = \Models\Thread::find(array('user.$id' => $user->id));
@wmendes yes that will work and is better than the first because you are only querying once.
If you need to specify the collection I often do this:
<?
ModelA::find(array(
'aRef' => array(
'$in' => array(
\MongoDBRef::create( ModelB::collectionName(), new \MongoId($id) )
)
)
));
Im trying to find a model based on reference, my code is below:
And im geting the error "zero-length keys are not allowed, did you use $ with double quotes?"
Someone know what im doing wrong? Thanks in advance and thanks for the great project.