Sorting by virtual field in mongoDB (mongoose)
You won't be able to sort by a virtual field because they are not stored to the database.
Virtual attributes are attributes that are convenient to have around but that do not get persisted to mongodb.
You won't be able to sort by a virtual field because they are not stored to the database.
Virtual attributes are attributes that are convenient to have around but that do not get persisted to mongodb.