0

I am trying to sort by a field with whitespace in the name, what is the workaround for this?

Query:

this.query = this.query.sort("Review Score");

Model:

["Review Score"]: {
  type: String,
},
karlrez
  • 61
  • 5

1 Answers1

1

For ascending:

this.query = this.query.sort({ "Review Score": 1 });

For descending:

this.query = this.query.sort({ "Review Score": -1 });
Dheemanth Bhat
  • 4,269
  • 2
  • 21
  • 40