In all cases where costs and disbursements are not allowed to the plaintiff, the defendant shall be entitled to have judgment in his or her favor for the same.[ 2011 c 336 s 122; Code 1881 s 510; 1877 p 109 s 514; 1869 p 123 s 462; 1854 p 202 s 372; RRS s 479.]