ODM in 0.8.0, can't put conditions in findFirst() or find()

101 views
Skip to first unread message

kiang

unread,
Jan 31, 2013, 1:43:17 AM1/31/13
to pha...@googlegroups.com
$organization = Organizations::findFirst() return one object. But when I trying to have conditions inside like

$organization = Organizations::findFirst(array(array('tax_id' => $taxId)));

It just can't find anything.

Query in mongo console could get correct object:
db.organizations.findOne({tax_id: "$taxId"})

* also tested in 0.9.0 beta.

---
kiang

Vitaly Alyokhin

unread,
Jan 31, 2013, 2:38:59 AM1/31/13
to pha...@googlegroups.com
why double array? Organizations::findFirst(array(array

findFirst(array('key = :key:'))


2013/1/31 kiang <kia...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "Phalcon PHP Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phalcon+u...@googlegroups.com.
> To post to this group, send email to pha...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/phalcon/-/swMacq3HZjkJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
С уважением, Виталий.

Vitaly Alyokhin

unread,
Jan 31, 2013, 2:40:29 AM1/31/13
to pha...@googlegroups.com
sorry
findFirst(array('key = :key:'), 'bind' => array('key' => 'anykey'))

2013/1/31 Vitaly Alyokhin <228...@gmail.com>:
--
С уважением, Виталий.

kiang

unread,
Jan 31, 2013, 7:42:46 AM1/31/13
to pha...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages