MongoDB fixes - use of primaryKey instead of id