mongodb - CakePHP paginator ignoring order, but only for certain values -


While pagging my user model in kppp, I can sort with some values, but not others. For example, I can order results from created or email , for example, but username or reputation seems to come back order by arbitrary command for example with a list of users:

$ this-> paginate = array ('condition' => array ( 'User.is_active' = & gt; true), 'border' => 24, 'order' => array ('User.created' => DESC));

Works as expected, but

$ this - & gt; Paged = array ('conditions' = & gt; array (' user.isIactive '= & gt; true),' border '= & gt; 24,' command '= & gt; array (' user repeats' = ' & Gt; DESC '));

No, no.

I first thought that this could be a database issue, but when I search the database directly, sorted as expected.

Note: I am using Mangodebi with the Mongo DB plugin of Ichikawa for the KPPHP; Pagnetizing users are used to work properly, so I do not think there is a bug with this plugin, but something has changed somewhere and I can not understand what.

Finally, when I look at the query in debug information, I can see that the command value is not even going to be searched while searching the KHHP database, the first search above shows. :

db.users.find ({"is_active": true}, []) .sort ({"created": - 1}) .limit (24). Skip (0)

And the second is:

db.users.find ({"is_active": true}, []). Sort ([]) .Milit (24). Skip (0)

Why is the KPPHP giving me some things, but not others?

Ohs it was a database error; In some way, it got a record with only a few fields (eg, _ id, created, modified, and some others), which were coincidentally only those that I could sort. Removing it made everything back normal.

It is strange that someone will be cured by doing a search, but will not do pagnetizing with similar parameters. Maybe it's a plugin / cake bug?

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -