【发布时间】:2019-01-19 09:07:55
【问题描述】:
我正在尝试将时间戳设置到 firebase 实时数据库中,但是当我检索时,不是按时间戳排序。 我确实喜欢。
FirebaseDatabase.instance.reference().child('path').push().set({
'timestamp': ServerValue.timestamp
});
这是节点
然后我就这样检索了。
FirebaseDatabase.instance.reference().child('path').orderByChild('timestamp').once().then((snap) {
print(snap.value);
});
但输出是这样的
{-LJhyfmrWVDD2ZgJdfMR: {timestamp: 1534074731794}, -LJhyWVi6LddGwVye48K: {timestamp: 1534074689667}, -LJhzDlvEMunxBpRmTkI: {timestamp: 1534074875091}
那些不是按时间戳排序的。 我错过了什么吗? 否则这是 firebase 错误还是颤振?
【问题讨论】:
标签: firebase-realtime-database flutter