Context.user is empty

I have a scheduled trigger once a minute that runs a function. In the function - I need the authenticated user’s ID, but it’s undefined. Why?

Here’s my trigger:

Here’s the function:

exports = async function(){
  var serviceName = "mongodb-atlas";

  // Update these to reflect your db/collection
  var dbName = "todo";
  var userCollName = "User";
  var formCollName = "Form";
  var notifCollName = "PushNotification";
  var notifPrefCollName = "NotificationPreferences";
  const daysOfWeek = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];

  // Get a collection from the context
  var prefCollection =;
  var notifCollection =;
  var userCollection =;
  var formCollection =;
   const user = context.user
   console.log("userid ",

I get this error:


  "userid  ",
  "Error occurred while executing find: ObjectId in must be a single string of 12 bytes or a string of 24 hex characters"