Skip to content

Push multiple objects at once #76

@aaossa

Description

@aaossa

Hi, I'm trying to push multiple objects using one requests but I couldn't fin a way to do this using this gem. See this SO question for reference, it's in JS but the problem is the same. It looks like it is possible to push multiple objects at once using JS, so I think should be possible using this gem.

What I want is to start from something like this:

|> container
  |> -Km4sgiVoeXVx4ZLKe9a # parent_id
    |> div

Then I push multiple objects. Something like firebase.push("container/#{parent_id}/div", array), with an array like [{ a_key: A}, { a_key: B}, { a_key: C}] (currently this assigns the array index as ID).

Desired output:

|> container
  |> -Km4sgiVoeXVx4ZLKe9a # parent_id
    |> div
      |> -Km8IlUaZfgrrUB5tXQt # <= This is one of the objects I want to create
        |> a_key: A
      |> -Km8NBTEsaM1ElVBHNfH # <= Another created object
        |> a_key: B
      |>  -Km8NDYxTc0ldb_XV7Ti # <= Another created object
        |> a_key: C

Can I accomplish this using this gem? Is there another way to do this with just one request? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions