Where clause = problem
Hi, I have problem with this function in AngularJS:
Posts.find({
"where": {
"and": [
{"month_year": "2017-01"},
{"id_lek": "587ca62f8b90cb2b70b87d9b"}
]
}
}
, function ( posts) {
console.log( posts.length);
});
}
This function always return me 1(true). In Mongo i have one record, id_lek is not change, i change month_year (in db is value: "2017-01") when I change in {"month_year": "2017-02"} this function return me True but should return 0 (false) beacuse in DB there is no such record.
Please help me! where is wrong?
Posts.find({ filter: { "where": { "and": [ {"month_year": "2017-01"}, {"id_lek": "587ca62f8b90cb2b70b87d9b"} ] } } } , function ( posts) { console.log( posts.length); }); }
Still not working:/ Now function always return me 0 (false).
Look this is my DB Posts (one record)

This is from console.log (firs row is where clause who use to find function), second row is posts.length
I know where is problem:
When I have id_lek with "-" on end.

Where clause working, when my id is without "-" where clause is not working.
Tell my why, when add "-" to the id is work, without is don't
This is kind of weird when I reproduced this issue with mongodb. There is probably some restriction with the format of the number that @kogutu is passing.
I have created a boot script which is:

and if i run the code I get:

and my mongo collection has the data:

But any other format/ same length id_lek /different length id_lek will work. for e.g

output:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.