Progress on filters
This commit is contained in:
@@ -11,11 +11,6 @@ const PORT = process.env.PORT || 3001;
|
||||
const AGENTURA_KEY = process.env.AGENTURA_KEY || '1somethingverysecret';
|
||||
|
||||
let db;
|
||||
//Monogo = await MongoClient.connect(url);
|
||||
|
||||
// TODO:
|
||||
// db.results.ensureIndex({loc:"2d"})
|
||||
//collection.ensureIndex("username",callback)
|
||||
|
||||
router.get('/search', async (req, res, next) => {
|
||||
try {
|
||||
@@ -99,7 +94,10 @@ router.get('/search', async (req, res, next) => {
|
||||
}
|
||||
|
||||
console.log('QUERY: ', query);
|
||||
const all = await properties.find(query).toArray();
|
||||
const all = await properties.find(query, {
|
||||
//"sort": [['field1','asc'], ['field2','desc']]
|
||||
"sort": [['price','asc']]
|
||||
}).toArray();
|
||||
|
||||
res.json(all);
|
||||
res.end();
|
||||
|
||||
Reference in New Issue
Block a user