Hello, folks, is so nice to being use Fauna, I’ve been using it since I started this personal project (as per Fireship’s Youtube channel, it’s awesome indeed), I even recommended the company I’m working to use it.
Right now, I’m having a strange problem. I’m trying to update and delete a document, based on an index. I’ve done that for several collections (entities), but this specific one is not working.
This is the error I’m getting:
Error: [
{
"position": [],
"code": "instance not found",
"description": "Set not found."
}
]
This is my collection:
{
"ref": Ref(Collection("units"), "327742118188548163"),
"ts": 1648818090540000,
"data": {
"id": "a8293d39-01bc-4f43-bb80-2f0c528422d1",
"name": "Matriz",
"location": "Piracicaba - São Paulo",
"address": "Rua Dona Eugênia, 402. Jardim Europa - Piracicaba, São Paulo. CEP 13416-401.",
}
}
It uses an index for it’s id behind the scenes, here it is:
My queries are:
update -
Update(
Select(['ref'], Get(Match(Index('unit_by_id'), updateUnitDto.id))),
{
data: updateUnitDto,
},
),
delete -
Delete(Select(['ref'], Get(Match(Index('unit_by_id'), id))))
Strangely enough, I’m using the same queries for updating/deleting records from multiple collections, all work, but this one. I’m already aware of the issue mentioned by @ptpaterson at Instance not found even though instance exists and unique rule being ignored - #5 by aprilmintacpineda, regarding indexes caching.
The problem is that I’ve already created this index 3 hours ago, it’s still not working. I’ve also tried running the query in the shell, but I’m still getting the error (please see it attached in the comment below, as a new user, I can only post one embedded media per post)
Is there anything really obvious that I’m missing? Is 3 hours not enough for the cache of indexes to be updated?
Thanks in advance for your support.