Hi!
Very interesting project, looking forward for it!
On Fri, Oct 26, 2012 at 3:44 PM, Dariusz Górecki <
dare...@gmail.com> wrote:
> - EMongoCritera is rewritten too, for support of *complex* operators like
> `$or`
Did you consider making it compatible with the way criterias are
described in php/mongo? The current EMongoCriteria class requires
different way to specify a query than you would do in mongo/php. My
experiences shows that it's quite confusing for most of the
developers, and hard to learn. Especially if you put together a
criteria in the mongoshell, then try to move it to your ymds based
code makes lots of errors.
It would be nice if one should learn only one of the syntaxes instead
of two. I would reconsider dropping EMongoCriteria as a whole, if it
does not add too much feature, or just to focus on other added
features (field selection, etc)
Example of what I mean:
mongoshell> db.product.find({color: 'red', price: {$gt: 10}});
//plain php, basically the json_decoded version of the above
$collection->find(array('color' => 'red', 'price' => array('$gt' => 10)));
// ymds, this is the shortest form I know of
Product::model()->find(array('conditions' => array('color' =>
array('==' => 'red'), 'price' => array('gt' => 10))));
So the latter could be much simpler if I could just use the same array
that I use in the second example, especially when it comes to complex
operators.
--
Nagy Attila Gabor