- Ctrl + b: Move to beginning of line
- Ctrl + e: Move to end of line
- Ctrl + h/j/k/l: Move left / down / up / right (respectively)
This document provides schema design examples and corresponding GROQ queries for various use cases. It’s a practical guide for developers to get familiar with GROQ querying and the basics of Sanity schema design.
Use the following query to retrieve a list of all unique top-level types in your dataset:
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import { NextApiRequest, NextApiResponse } from "next"; | |
| export default async function handler( | |
| req: NextApiRequest, | |
| res: NextApiResponse | |
| ) { | |
| if ( | |
| !req.query.revalidate_token || | |
| !process.env.REVALIDATE_TOKEN || | |
| req.query.revalidate_token !== process.env.REVALIDATE_TOKEN | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Naive recursion. | |
| function fib1(n) { | |
| if (n <= 1) { | |
| return n | |
| } | |
| return fib1(n - 1) + fib1(n - 2) | |
| } | |
| { | |
| console.log('fib1') | 
$ redis-cli --rdb dump-before.rdb save
$ redis-cli --rdb dump-after.rdb save
$ pip install rdbtools python-lzf
$ rdb --command diff dump-before.rdb | sort > sorted-dump-before.out
$ rdb --command diff dump-after.rdb | sort > sorted-dump-after.out
$ diff sorted-dump-before.out sorted-dump-after.out
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | type PartiallyRequired<T, K extends keyof T> = Pick<T, K> & Partial<T>; | |
| type Test = { | |
| foo: string; | |
| bar: string; | |
| baz: string; | |
| }; | |
| type Test1 = PartiallyRequired<Test, "foo">; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Matchers | |
| ^ | |
| Match starting position | |
| . | |
| Match any single character, enclose in bracket for literal dot | |
| a.c -> "abc", etc. | |
| [a.c] -> "a", ".", "c" | |
| [ ] | |
| Match single character, or character within range | |
| [abc], [a-c] -> "a", "b", "c" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | AWSTemplateFormatVersion: "version date" | |
| " String | |
| Description: | |
| " template metadata | |
| " arbitrary yaml | |
| " CloudFormation helper scripts | |
| " cfn-init, cfn-signal, cfn-get-metadata, cfn-hup | |
| " Resources can have Metadata (install scripts, etc.) | 
NewerOlder