0
$\begingroup$

This is from doc"

DatabinRemove[bin,uuid]

removes the entry with the specified UUID from a databin."

But I don't find any instruction to explain how to specify a record UUID for a databin. Can one of the data columns to be specified as UUID? or it is automatically assigned when DatabinAdd?

$\endgroup$
2
$\begingroup$

It is automatically assigned.

Get[bin]

will return a list of associations that includes the data and UUID for every value in the bin.

Update with more details

bin = CreateDatabin[]
DatabinAdd[bin, 1234]
DatabinAdd[bin, 5678]
Databin[bin, -1]["UUID"] (* UUID of last item *)
First[Select[Get[bin], #Data == 1234 &]]["UUID"] (* UUID of first item with value 1234 *)
$\endgroup$
  • $\begingroup$ I got to understand what "UUID" refers now. My real problem is that I want to remove a certain record (association) from the bin. How can I find the internal UUID of that specific record? To do a select on databin, like Dataset[Databin[binName]][Select[#column === "test"] &, "UUID"]? Is there an easy way to get it at DatabinAdd step? $\endgroup$ – user1470393 Feb 8 at 4:57
  • $\begingroup$ @user1470393 Updated answer with more details. Does that help? $\endgroup$ – Rohit Namjoshi Feb 8 at 16:00
  • $\begingroup$ This helps, but this is what I have known. Using last item is not a reliable solution for multi thread (multi client) application. Search the data every time has a performance concern. It would be better if DatabinAdd[bin, 1234] will return the UUID of that record. And then I can directly use that UUID if I need to remove the record later. It is possible to do it as search, but not of the best performance. $\endgroup$ – user1470393 Feb 8 at 23:26
  • $\begingroup$ @user1470393 Adding and deleting from Databin are both pretty inefficient operations. DatabinUpload is much more efficient for adding many values. For the use case you are describing it seems Databin is not the right solution. It is meant to be a mostly read only store. Also I don't understand how it would help if DatabinAdd returned the UUID, you still need to store that UUID somewhere so you can access it to perform the delete. Regarding mullti-client, you can use this to serialize access. $\endgroup$ – Rohit Namjoshi Feb 9 at 1:55
  • $\begingroup$ Thanks for your reply. I am trying to build a backend using Mathematica, meaning multiple clients will simultaneously search and insert records in a database. What technology should I be using for this purpose? $\endgroup$ – user1470393 Feb 18 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.