Data:
{
"ref": Ref(Collection("eventInvitations"), "306981091611247115"),
"ts": 1629018832705000,
"data": {
"eventId": "304363317135147532",
"userId": "301269945372639745",
"inviterId": "295664230831489541",
"createdAt": "2021-08-15T09:13:52.474854Z",
"updatedAt": "2021-08-15T09:13:52.474854Z"
}
},
{
"ref": Ref(Collection("eventInvitations"), "306981098447962635"),
"ts": 1629018839220000,
"data": {
"eventId": "304363317135147532",
"userId": "295664821370618375",
"inviterId": "295664230831489541",
"createdAt": "2021-08-15T09:13:59.044803Z",
"updatedAt": "2021-08-15T09:13:59.044803Z"
}
}
index:
CreateIndex({
name: 'eventInvitationByUserEvent',
source: Collection('eventInvitations'),
terms: [
{ field: ['data', 'userId'] },
{ field: ['data', 'eventId'] }
],
unique: true
})
query:
Exists(
Match(
Index("eventInvitationByUserEvent"),
"295664821370618375",
"304363317135147532"
)
);
Expected: Should have returned true
because the record exists, but it returned false
saying the record does not exist.
{
"ref": Ref(Collection("invitations"), "306981098447962635"),
"ts": 1629018839220000,
"data": {
"eventId": "304363317135147532",
"userId": "295664821370618375",
"inviterId": "295664230831489541",
"createdAt": "2021-08-15T09:13:59.044803Z",
"updatedAt": "2021-08-15T09:13:59.044803Z"
}
}
Using get:
Get(
Match(
Index("eventInvitationByUserEvent"),
"295664821370618375",
"304363317135147532"
)
);
Throws:
Error: [
{
"position": [],
"code": "instance not found",
"description": "Set not found."
}
]
BUT IT SHOULD NOT THROW BECAUSE THE RECORD EXISTS
{
"ref": Ref(Collection("invitations"), "306981098447962635"),
"ts": 1629018839220000,
"data": {
"eventId": "304363317135147532",
"userId": "295664821370618375",
"inviterId": "295664230831489541",
"createdAt": "2021-08-15T09:13:59.044803Z",
"updatedAt": "2021-08-15T09:13:59.044803Z"
}
}
This doesn’t happen before but it seems it does now, I don’t know what’s up with this but seems reliability is down, hard for me to trust faunadb at this rate.
EDIT 1:
I also recently downgraded to FREE as I continue to develop the app, I don’t know if that has any impact on this.
EDIT 2:
Duplicates have also started appearing:
{
"ref": Ref(Collection("eventInvitations"), "306982606624260678"),
"ts": 1629020277530000,
"data": {
"eventId": "304363317135147532",
"userId": "295664821370618375",
"inviterId": "295664230831489541",
"createdAt": "2021-08-15T09:37:57.278517Z",
"updatedAt": "2021-08-15T09:37:57.278517Z"
}
},
{
"ref": Ref(Collection("eventInvitations"), "306983062861775371"),
"ts": 1629020712774000,
"data": {
"eventId": "304363317135147532",
"userId": "295664821370618375",
"inviterId": "295664230831489541",
"createdAt": "2021-08-15T09:45:11.422421Z",
"updatedAt": "2021-08-15T09:45:11.422421Z"
}
}
Notice same eventId
and userId
but it was declared as unique.