Inline variable dereferencing of object field names
# Logan Smyth (7 years ago)
Assuming in your first example you meant
query.$pull[team] = userId;
not
query[team] = userId;
then your second example is already valid a ES6 computed property and does exactly what you appear to be looking for.
An HTML attachment was scrubbed... URL: esdiscuss/attachments/20170723/63b44636/attachment-0001