Selecting multiple fields in an FQL query

Share this video with your friends

Send Tweet

You can use array and object literals to compose multiple selections into a single query, such as within a lambda.

Map(
  Paginate(Match(Index("all_customers"))),
  Lambda(
    "X",
    Select(["data", "firstName"], Get(Var("X")))
  )
)

with arrays

Map(
  Paginate(Match(Index("all_customers"))),
  Lambda(
    "X",
    [
      Select(["data", "firstName"], Get(Var("X"))),
      Select(["data", "lastName"], Get(Var("X")))
    ]
  )
)

with objects

Map(
  Paginate(Match(Index("all_customers"))),
  Lambda(
    "X",
    [
      Select(["data", "firstName"], Get(Var("X"))),
      Select(["data", "lastName"], Get(Var("X")))
    ]
  )
)

Map( Paginate(Match(Index("all_customers"))), Lambda( "X", { firstName: Select(["data", "firstName"], Get(Var("X"))), lastName: Select(["data", "lastName"], Get(Var("X"))) } ) )