A Cop is a public employee and they will do their "lawful" duty just like in the Military but the key word is LAWFUL. Unless the 2nd is repealed IMHO AWB's are unlawful but this is what happens when liberal Dems get to appoint leftist judges.
Except just like the military "Lawful" is defined by those above you who give the orders. So unless it's something so far out of the ordinary to be obvious ("Go get that guy, he has an illegal gun and while you are there execute his family for defying us") then they will follow it. Not following orders means they get fired, lose their income, lose their retirement, and lose their power and side benefits of being a cop. Haven't seen any of them refusing to enforce AWB's, or mag restrictions, or any other nonsense. Some will ignore things on the ground when they can, but none will refuse to kick a door or make an arrest.