Return undefined, if the field is optional and no values are set.

Currently, getting the value from optional field occurs error if value
is not set. It's a bug.

This patch makes it return an undefined.
Fix typo. ObjectID -> ObjectId.

The name had been changed after
cf55bf4e36d5c9138e126b6df4dea519dccd1771.