How to Delete Documents with where clause in firebase firestore - google-cloud-firestore

I have a problem with my code. I would like to delete the ward beds that has an fk with them. Here is my current structure.enter image description here
enter image description here

Related

Database structure of product images

At the moment I have 3 table: products, images, products_images.
So, basically I store product's images in "products_images" table.
When a product is updated, I remove all rows from "products_images" table related to that product, and add new one.
Also, I need to save the order, now the order is how they are stored in database.
Is this correct approach? Or maybe there are a better database structure to store product's images?
Entity relationship consideratoin
If you don't share images between products (never use one image for more than 1 product) then your relationship is really One-To-Many and there is no need for products_images junction table. This would simplify your model to:
Products (id_product, ...)
Images (id_image, ..., id_product)
And id_product in Images table would have a Foreign Key pointing at Products(id_product). That way, when you want to detach all images from a product you would simply run an update statement:
UPDATE images SET id_product = NULL WHERE id_product = ?
Sorting consideration
Since you need to save the order in which images are stored in the database, depending on what columns you have in Images table you could use for example id_image if it was declared as SERIAL (auto-incremented integer value). As a rule of thumb in PostgreSQL (where there are no clustered indexes) remember that if you need the output sorted, you need to do that yourself (example: add an ORDER BY id_image) at the end.

oracle form ''you cannot update this record''

I have a procedure in which I get values from different tables and calculate a certain decimal number. After that i try to post it on a form text-field which is a database item (update and insert allowed on the settings of block and item). everything works fine but the result wont show on the item and won't save in the database field. I get the error
"you cannot update this record".
Can someone help? i have been working on it for two days now and can't find anything.
Did you check if your user has update access on the table?
Check also if there are database triggers on the table that prevents you from updating the record.

FileMaker Pro 13: Relationship between a text field and a container field

I'm new to Filemaker.
I want to create a database for my library.
Lets say we have a text field for the title of each book (book_title) and a container field for the cover photo (cover_photo).
I'd like to help me write a script that would allow me to copy the photo (that is, the content of "cover_photo") from one record to the other if the field "book_title" is identical within two records.
For example: lets say I have 5 copies of a book in my library. For the first copy I'll create a new record and I'll write the title in "book_title" field and I'll insert a photo in "cover_photo" field. But for the second/third/... copy I'd like to write only the title and, since it will match with the title of the first record, enter automatically the photo in the first "cover_photo" field without inserting it again.
I'd appreciate any help.
Thank you.
IMHO, it would be much better to use two tables, say Titles and Exemplars, with a one-to-many relationship between them. The cover photo would be stored in a field in Titles, and all the child exemplars could display it without you having to duplicate it.
This is assuming you have something unique to record about each exemplar - otherwise you could simply have a field for Quantity in the Titles table.

CloudKit record exists (added days ago), does not get returned by query but can be fetched by ID

I have a situation where a CloudKit record is not being returned by a query (and also doesn't appear in the CloudKit dashboard), but it exists when fetching it by it's ID.
The record was added days ago, so it really should have been indexed.
The record ID metadata index has always been set for the record type.
The query I use is fetching all records for a particular record type in a custom zone.
Strangely, when I search for the record in the dashboard and select it, the record name field is blank on the detail panel.
It's very peculiar, and very concerning!
Anyone have any ideas?

How do I determine the portal row number?

How do I determine the portal row number when dragging a document into a container field in FileMaker? Dragging a document into a container field doesn't change focus, so Get(ActivePortalRowNumber) doesn't work.
Well, you could have a second relationship to the same related records sorted by the modification dates of the related records, most recent first. Then the record that had had the document dragged into the container field would appear as the first related record via that relationship, and you could grab an ID field from it.
Alternatively, each related record in the portal could contain an unstored calculation field set to "get(recordnumber)". Within a portal, that will evaluate to the portal row number of the record. Maybe you could use that somehow. Without more information on what you're trying to accomplish, though, it's tough to say.