title: Mongoose query between values Express Js
body: <p>am playing with MongoDb and Mongoose, and I am trying to filter by price range, for example display properties from 0 to any number (10000),</p>
  
  <p>My model is very simple: </p>
  
  <pre><code>const mongoose = require('mongoose');
  
  const PropertySchema = mongoose.Schema({
      title: String,
      description: String,
      price: Number,
      town: String
  })
  
  
  module.exports = mongoose.model('Property', PropertySchema);
  </code></pre>
  
  <p>And route. this what am up to, set price from 0 to any number, I don’t want to hard-code this max value</p>
  
  <pre><code>const express = require('express');   
  const router = express.Router();
  const Property = require('../models/Property'); 
  
  router.get('/', async (req, res) =&gt; {
      try {
          const properties = await Property.find({ price: { $in: [ 0, 0 ] } });
          res.json(properties);
      } catch (err) {
          res.json({ message: err });
      }
  });
  </code></pre>
  
  <p>URL</p>
  
  <pre><code>properties?price=0&amp;10000
  </code></pre>
  
  <p>Can anybody help me with this? How can I set range of price for properties?</p>