chore(api): show online devices first
This commit is contained in:
parent
8f226d09a9
commit
5fd6afc8fa
|
|
@ -109,9 +109,12 @@ func (a *Api) retrieveDevices(w http.ResponseWriter, r *http.Request) {
|
||||||
//TODO: Create filters
|
//TODO: Create filters
|
||||||
//TODO: Create sorting
|
//TODO: Create sorting
|
||||||
|
|
||||||
|
sort := bson.M{}
|
||||||
|
sort["status"] = 1
|
||||||
|
|
||||||
filter := bson.A{
|
filter := bson.A{
|
||||||
//bson.M{"$match": filter},
|
//bson.M{"$match": filter},
|
||||||
//bson.M{"$sort": sort},
|
bson.M{"$sort": sort}, // shows online devices first
|
||||||
bson.M{"$skip": skip},
|
bson.M{"$skip": skip},
|
||||||
bson.M{"$limit": page_size},
|
bson.M{"$limit": page_size},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user