Closed lordent closed 5 years ago
Hmmm... I don't think we support sorting by a field you didn't define. Since _id is an autogenerated field, you won't be able to sort by it. Sorry. :(
@heynemann I think, that _id is same fileds as ather, for example, if u created two records like {name: 'A'} and {name: 'B'}, then default sorting to be _id, right?
Hi, i try to sorting queryset and get this error:
File "/env/lib/python3.4/site-packages/motorengine/queryset.py", line 443, in order_by raise ValueError("Invalid order by field '%s': Field not found in '%s'." % (field_name, self.klass.name)) ValueError: Invalid order by field '_id': Field not found in 'Model'