Question: List monomials in a polynomial, each as a coefficient and an exponent vector

Given a polynomial, e.g. 3*x^2 + a*x*y + b*y^2, is there some built-in function which can give me a list of monomials, with each monomial represented as [coefficient, [exponent_of_x, exponent_of_y]] ? The above polynomial would turn into something like [ [3, [2,0]], [a, [1,1]], [b, [0,2]] ].

It's not difficult to write this procedure from scratch. The procedure would require two arguments: (1) the polynomial itself, (2) which symbols are considered variables (in the above case, x and y). The remaining variables, a and b, would then be treated as constants that appear as coefficients. But I'm wondering if there's a built-in function I can just use.

Please Wait...