-
Notifications
You must be signed in to change notification settings - Fork 21
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
updateAll is not working properly #13
Comments
@svlungade can you give some more details as to what is in the array you are passing to the updateAll function? The update all function works for me when passing in the following array: User.updateAll( [ {'id': 1}, {'id': 2}, {'id': 3}, {'id': 4}], { 'updated' : true}, callback); |
TestDocument.updateAll( {id: "1234"}, {email: "abcd55@gmail.com"}, function(err, results) { Where id is a primary key (_id) and the first json is the condition and second is the one to be updated This is what we are trying to do |
@svlungade what is the error you see if any when you try to call the above code? I'm not sure I understand where the TypeError k.match error is coming from. |
@flam312 - Thank you for the quick replies :). Second issue is ... when we are trying with the example given, we are getting blank results, nothing gets updated. |
@svlungade { Or if the id does not exist then the results will return { count: 0}. |
In your first example the where clause is invalid it must be an object, not an array. You should have received an error like so: { [Error: The where clause [{"id":1},{"id":2},{"id":3},{"id":4}] is not an object] statusCode: 400 } https://docs.strongloop.com/display/public/LB/Where+filter In the second case, you should get a response say |
When given an array as input for a field, we are getting TypeError k.match is not a function.
We cannot give primary id as where clause in input parameter.
Both the issues are for updateAll method
The text was updated successfully, but these errors were encountered: