move queryFromPath into it's own function and rename queryFromPath to mongoQueryFromPath