3
我有一個模式,它看起來像這樣貓鼬排序功能
var user = new Schema({
preference1: { // preference is a number between 1 - 10
type: Number
},
preference2: { // preference is a number between 1 - 10
type: Number
}
})
我怎麼找到的文件,排序上的偏好領域的功能?說fn
是這樣
fn = Math.abs(preference1 - 3) + preference2^2