【发布时间】:2020-11-06 11:59:42
【问题描述】:
我正在尝试使用服务器时间戳字段上的 where 条件进行查询,工作很完美,但是当它离线时,快照不会触发,直到它再次在线。当我删除 where 条件时工作正常。
是否可以使用此服务器时间戳字段脱机工作?还是我做错了什么?
这是我的查询:
firestore()
.collectionGroup(collectionNames.MESSAGES)
.where('chatId', 'in', chatIds)
.where('updatedAt', '>', lastMessageDate)
.onSnapshot({ includeMetadataChanges: true }, onMessage, onError)
这是我的对象:
create({ chatId, type, text, url, user }) {
const { id, email, name, avatarUrl } = user
this.chatId = chatId
this.type = type
this.text = text
this.url = url
this.ownerId = id
this.ownerEmail = email
this.ownerName = name
this.ownerAvatarUrl = avatarUrl
this.updatedAt = firestore.FieldValue.serverTimestamp()
return this.toJSON()
}
【问题讨论】:
标签: javascript firebase react-native google-cloud-firestore react-native-firebase