convert post to mongo query