DEV Community

Scott Watermasysk
Scott Watermasysk

Posted on • Originally published at scottw.com on

1

Select Multiple Fields With Fauna

I am thinking of using Fauna for my next small side project and began experimenting with it last night. I wanted to return two fields from a document, but I could not get the syntax correct.

I was working under the assumption that SelectAll would allow me to extract multiple fields, but it turns out this is for returning multiple items from an array.

I posted a message in their slack group1 and learned that you could pass an array to the Lambda with more than one Select.

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

Enter fullscreen mode Exit fullscreen mode

  1. Slack is such a bad option for support like this. All the answers are locked in their walled garden. 

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (1)

Collapse
 
overfocus profile image
Kevin Ferron

Thank you.. FQL is mindbending

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay