Add None checking for the Mongodb uri

Change-Id: I9163c772d773ebecc51a88dc2280e8dba8ede009
Closes-Bug: #1334750