node.js - Wierd mongoose / mongodb behavior -


why in mongoose (or mongodb maybe) boolean false not saved in database present in result.

mongoose schema: fav : { type: boolean, default: false }

now if mark true (via form input) , stored in database otherwise not saved if 'undefined' (if not checked in form).

but if fetch field output appropriate result expected. i.e if fav true 'true' else false.

the problem if want query docs fav false empty array returned because when value false field (fav) not saved in database, can query fav==true because saved in database.


Comments

Popular posts from this blog

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -