【发布时间】:2018-10-18 03:19:06
【问题描述】:
我在我的数据对象中使用 ServerTimeStamp,现在我只想检索当前的数据。
var happycount = admin.database().ref(`/tariq-road/happy`)
.orderByChild('timeStamp')
.equalTo(Date.now())
.once('value', (snapshot) => {
var data = snapshot.numChildren()
console.log('data: ', data)
})
我如何获得今天的数据?
【问题讨论】:
-
您应该将时间戳对应的日期与时间戳一起存储。
标签: javascript firebase firebase-realtime-database google-cloud-firestore