Saturday 22 April 2017

MongoDB Range Issue

I'm using nodejs and mongodb. I want to search docs between a num range but the function allways give me number that outside the range. For example, this is my function and I want to get the results of the docs that they has a field size with the numbers between 1 to 1200:

                            db.collection(example).find({
                                size: {
                                    "$gte": 1,
                                    "$lte": 1200
                                }
                            }).toArray(function (err, results) {
                                db.close();
                                console.log("results="+results);
                            });

thanks anyway :)



via RandomGuy17

No comments:

Post a Comment