conditionally publish path elements, add mongodb path element