Hi i'm trying to translate this javascript expression with mongo:
db.zipcodes.find( { $where: "69900002 >= obj.LOC_CEP_INI && 69900002 <= obj.LOC_CEP_FIM" } );
To a mongo query. I need that because the javascript is not performatic for query big data.
What i need is search objects where the field LOC_CEP_INI is bigger or equal to 69900002 and LOC_CEP_FIM is equal or smaller than LOC_CEP_INI Thanks!
OUTPUT Example (69900002 is bigger than LOC_CEP_INI and 69900002 is smaller than 69900002:
{
"create_date": "2016-04-12T20:17:34.397Z",
"__v": 0,
"UFE_SG": "AC",
"MUN_NU": "1200401",
"LOC_NU": "00000016",
"LOC_NO": "RIO BRANCO",
"LOC_CEP_INI": 69900001,
"LOC_CEP_FIM": 69923999,
"_id": "570d57de457405a61b183ac6"
}