This is in relation to 
http://stackoverflow.com/questions/23367218/web2py-dal-how-to-check-liststring-type-items-for-none

Answer works when tested on sqlite but does not work for Mongodb....

    In [4]: db.Tasks.email != [ ]

Creates the mongo query :

    Out[4]: <Query {'email': {'$ne': ' ' }}>


In mongo shell:

    > db.Tasks.find().count()
    1195 < total number of records.

    > db.Tasks.find({'email': {'$ne': ' ' }}).count()
    1195 

The correct query should be:

    >db.Tasks.find({email: {$ne: [ ] }}).count()
    108


But looks like the DAL is converting empty list to empty string instead. Is 
there anyway to force the DAL to retain the empty list when handed off to 
mongodb?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to