docs: function getObjectIdFromRefField (val) {
  
      let oid = linz.mongoose.Types.ObjectId;
  
      // Determine if we have an ObjectId or an Object with an ObjectId in it.
      // { type: 'modelName': _id: ObjectID() }
      // If `val` exists, `val` itself is not an instance of ObjectId,
      // `val._id` exists, and `val._id` is an instance of ObjectId.
      if (val && !(val instanceof oid) && val._id && val._id instanceof oid) {
          return val._id;
      }
  
      return val;
  
  }