Hero built in collection indexes

Announcing Built-in Collection Indexes

We’re pleased to announce a new FQL capability that empowers users to write more concise and powerful FQL statements: built-in collection indexes, along with the Documents function!

Built-in collection indexes (Documents function) Preview

With built-in collection indexes, you no longer need to create your own “collection index” just to track all of the documents that exist within a collection.

For example, if you have a collection of documents called “widgets”, you would normally have created a collection index:

CreateIndex({
  name: "all_widgets",
  Source: Collection("widgets")
})

So that you could then retrieve all of the “widgets” documents with:

Paginate(Match(Index("all_widgets")))

Now, that “all_widgets” index is unnecessary. You can simply use this query:

Paginate(Documents(Collection("widgets")))

The advantages are:

  • You no longer need to create one index per collection, just to track a collection’s documents.
  • You can remove any existing collection indexes (provided that you update queries that involve them) to save on storage.

Note: As a Preview function, Documents is currently only supported in the JavaScript, Java, and Scala drivers for FaunaDB. Support for Documents in the C#, Go, and Python drivers will be available in a future release.

Conclusion

With our latest release, users now have access to built-in collection indexes, the new Documents function, and some internal bug fixes and improvements that increase stability and performance.

As the Documents function is in Preview, please let us know what you think so that we can incorporate feedback into the formal release. Visit our documentation to learn more.

What other functions would you like to see implemented in FaunaDB? Please reach out to me on our Community Slack and describe any other features that would make FaunaDB an obvious choice for your next project.