【发布时间】:2017-07-10 22:31:27
【问题描述】:
我想在 Firebase 数据库上运行查询并获得最佳匹配而不是完全匹配
所以我在代码中有这样的东西。
// Create the ref people in the DataBase
var people = admin.database().ref('/People');
people.orderByChild("mCalculateLeftEyeSizeWidth").equalTo(mCalculateLeftEyeSizeWidth()).on("child_added", function(snapshot) {
console.log(snapshot.key);
});
这个当前查询是为了精确匹配,我正在处理双值
(值示例:14.212670403551895)
这永远不会给我完全匹配,但我想得到最好的匹配。与该数字接近的值,我该怎么做?
【问题讨论】:
标签: javascript firebase firebase-realtime-database