How to count actual affected nodes for updating operations?

MATCH (m:Product)
REMOVE m.price
RETURN count(m) as count

Even if my Product nodes don't have the property 'price', it still returns the total number of product nodes. How can I return the count of nodes that have been affected by the REMOVE command? For example, if Product nodes don't have any 'price' property', it should return 0; if 100 product nodes have 'price' property while other product nodes don't have this property, it should return 350.

How to modify this query?

How about adding a where clause? something like

MATCH (m:Product)
WHERE EXISTS(m.price)
REMOVE m.price
....

however if you're using one of the drivers you can look at the query statistics to see counters.propertiesSet ( in the browser you can find it if you click the Code tab in the results pane )