Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch write isn't working as expected when updating arrays #136

Open
drewdearing opened this issue Jul 4, 2024 · 0 comments
Open

Batch write isn't working as expected when updating arrays #136

drewdearing opened this issue Jul 4, 2024 · 0 comments

Comments

@drewdearing
Copy link

drewdearing commented Jul 4, 2024

I'm trying to use batched writes to do the following operation. The item gets removed but the array is not updated. This works in vanilla firestore.

const commit = batch(db);

const sceneID = ######;
const layoutID = ######;
const itemID = #####;

//remove item doc from scene subcollection
commit.layouts(layoutID).scenes(sceneID).items.remove(itemID);

//remove item id from item field in scene
commit.layouts(layoutID).scenes.update(sceneID, ($) =>
    $.field("items").set($.arrayRemove(itemID))
);

commit();
@drewdearing drewdearing changed the title Batch write isn't working as expected. Batch write isn't working as expected when updating arrays Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant