Closed csterritt closed 3 years ago
Is there any solution or workaround for this? I'm having the same issue for the same use case.
I'm thinking about creating and maintaining my own id attributes and base my logic and joins based on that... unless there is a better solution?
I also have this issue, but when trying to maintain a sync across browser and node backend. When updating, i have to use my own id, as the browser creates new ones and doesn't care that i gave it some already to match backend.
This is intended behavior. TaffyDB assumes you are working working with records likely flowing from another data layer than have attached IDs (or you are creating unique identifiers as you push data into it). The ___id value is internal and used to speed up lookups, manage updates to records, etc.
Hello,
Found a pretty substantial bug, IMHO.
My situation is that I'm using Taffy to store some state in a Node application.
I discovered that re-reading the database state from the saved file rewrites the "___id" field, based on (seemingly) the order that the databases are read in.
Here's the code that can demonstrate the bug:
Here's the output:
So I guess the question is, why would Taffy create new "___id"s when there are values already in the saved file? I was using them for table-to-table references, in effect a join.
Since Taffy supports
join
semantics, I figure it would want to support them on that field.My intent is to have a unique ID for each record, and figured I'd found it there. If it's not supposed to be used by application code, (A) what is it for, and (B) what's a reasonable workaround? I'd just as soon not search my records for the maximum ID, add one, and set that for a new record.
Thanks!