The TinyDB forum has found a new home at GitHub discussions. The content here remains as a read-only archive.
Is there any way to insert things into database with a specific EID, other than using swiss knife on the JSON? ?
Hey, right now there isn't a way to specify an EID when inserting. I'm not sure how that would work if the ID already exists, should it overwrite existing entries?
Cheers!
Raising KeyError would make sense to me unless optional overwrite flag would be set to true.
That's an interesting thought. If we add inserting with specified EIDs, I'd prefer it to never overwrite existing values to keep the API straight-forward (IMO that's what update is for, otherwise these to start to get mixed up). What do you think?
update