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

How to append to an array #211

Open
sammyraul opened this issue Mar 18, 2019 · 1 comment
Open

How to append to an array #211

sammyraul opened this issue Mar 18, 2019 · 1 comment

Comments

@sammyraul
Copy link

Example in README

Command = #{<<"$set">> => #{
    <<"tags.1">> => "rain gear"
  }},
mc_worker_api:update(Connection, Collection, #{'_id' => 100}, Command),

just replaces the element at the 1st position. What I wanted is add the element
at the start or end. Using "-1" does not work.
Any help would be highly appreciated. Thanks

@comtihon
Copy link
Owner

set command is not what you want.
Please try push or addToSet

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

2 participants