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

Bulk update using reactive mongo extensions: #11

Open
harmeetsingh0013 opened this issue May 21, 2015 · 1 comment
Open

Bulk update using reactive mongo extensions: #11

harmeetsingh0013 opened this issue May 21, 2015 · 1 comment

Comments

@harmeetsingh0013
Copy link

Is there any way to update bulk records. I am trying to update user object using following code:

    .update($doc("_id" $in (usersIds: _*)), users, GetLastError(), false , true)

In above code i am passing, users List. in user list i also add new properties and chage existing properties state, but with this statement the records are not updade

If i am using following code:

    .update($doc("_id" $in (usersIds: _*)), $set("inviteStatus" $eq "Invited"), GetLastError(), false , true)

The record updated successfully.

@harmeetsingh0013 harmeetsingh0013 changed the title Bul update using reactive mongo extensions: Bulk update using reactive mongo extensions: May 21, 2015
@fehmicansaglam
Copy link
Owner

What do you want to achieve? I understand that you have a list of users. And you want to update them at once with the corresponding user instance in the list? I am afraid this is not possible with one query. You can only pass the same document or update operator to a query. So you need to call update for each user in the list.

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