Error on filtering on list of floats with empty list
razbamnolker opened this issue · 2 comments
razbamnolker commented
razbamnolker commented
Created a PR for that issue : #2813
bagerard commented
Issue is broader than just this, in fact MongoEngine currently doesn't allow to use gt
operator with a list (empty or not). Although a bit confusing, MongoDB allows it
Given a collection with following documents
[{'_id': ObjectId('66bf8f26b5d653b25496d539'), 'ages': [1.0, 2.0]},
{'_id': ObjectId('66bfbcf20b7bba1c9071c6c1'), 'ages': []}]
Querying works like this (attaching this as results may not be what you expect)
Thus, querying on __gt = [ ]
will actually match any non-empty list, is it what you are trying to achieve?