PIM-2440: Make it work for MongoDB implementation