Use doc _id field to construct url

Docs don't always have an id property, so we use _id directly instead.