Use as_document instead of attributes
Store agent as attribute not mongodb field