text: // This snippet file was generated by processing the source file:
  // ./firestore-next/test.firestore.js
  //
  // To update the snippets in this file, edit the source and then run
  // 'npm run snippets'.
  
  // [START get_document_options_modular]
  import { doc, getDocFromCache } from "firebase/firestore";
  
  const docRef = doc(db, "cities", "SF");
  
  // Get a document, forcing the SDK to fetch from the offline cache.
  try {
    const doc = await getDocFromCache(docRef);
  
    // Document was found in the cache. If no cached document exists,
    // an error will be returned to the 'catch' block below.
    console.log("Cached document data:", doc.data());
  } catch (e) {
    console.log("Error getting cached document:", e);
  }
  // [END get_document_options_modular]