flask-mongoalchemy icon indicating copy to clipboard operation
flask-mongoalchemy copied to clipboard

Support remove queries

Open fsouza opened this issue 13 years ago • 3 comments

Add support to remove queries

fsouza avatar May 17 '11 05:05 fsouza

We can do on normal query:

Person.query.filter({'first_name' : 'John'}).remove_all()

fsouza avatar May 17 '11 06:05 fsouza

I tried with: Person.query.filter({'first_name' : 'John'}).remove_all()

But get following error message: TypeError: remove_all() takes at least 2 arguments (1 given)

What am I missing here? Thanks!

zqkou avatar Sep 01 '17 05:09 zqkou

@zqkou it looks like mongoalchemy now requires a qfield on remove_all. A qfield is an instance of mongoalchemy.QueryField: http://www.mongoalchemy.org/api/expressions/update_expressions.html#mongoalchemy.update_expression.UpdateExpression.remove_all

I'm not very familiar with the recent versions of mongoalchemy, but I can try to dig this up later. I'll reopen this issue.

fsouza avatar Sep 01 '17 13:09 fsouza