Update pp to deal with embedded documents