Show / Hide Table of Contents

Class Index

Cloud Firestore indexes enable simple and complex queries against documents in a database. This resource manages composite indexes and not single field indexes.

To get more information about Index, see:

  • API documentation
  • How-to Guides
  • Official Documentation

Example Usage - Firestore Index Basic

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var my_index = new Gcp.Firestore.Index("my-index", new Gcp.Firestore.IndexArgs
    {
        Collection = "chatrooms",
        Fields = 
        {
            new Gcp.Firestore.Inputs.IndexFieldArgs
            {
                FieldPath = "name",
                Order = "ASCENDING",
            },
            new Gcp.Firestore.Inputs.IndexFieldArgs
            {
                FieldPath = "description",
                Order = "DESCENDING",
            },
            new Gcp.Firestore.Inputs.IndexFieldArgs
            {
                FieldPath = "__name__",
                Order = "DESCENDING",
            },
        },
        Project = "my-project-name",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Index
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.Firestore
Assembly: Pulumi.Gcp.dll
Syntax
public class Index : CustomResource

Constructors

View Source

Index(String, IndexArgs, CustomResourceOptions)

Create a Index resource with the given unique name, arguments, and options.

Declaration
public Index(string name, IndexArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

IndexArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Collection

The collection being indexed.

Declaration
public Output<string> Collection { get; }
Property Value
Type Description
Output<System.String>
View Source

Database

The Firestore database id. Defaults to &quot;(default)&quot;.

Declaration
public Output<string> Database { get; }
Property Value
Type Description
Output<System.String>
View Source

Fields

The fields supported by this index. The last field entry is always for the field path __name__. If, on creation, __name__ was not specified as the last field, it will be added automatically with the same direction as that of the last field defined. If the final field in a composite index is not directional, the __name__ will be ordered &quot;ASCENDING&quot; (unless explicitly specified otherwise). Structure is documented below.

Declaration
public Output<ImmutableArray<IndexField>> Fields { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<IndexField>>
View Source

Name

A server defined name for this index. Format: 'projects/{{project}}/databases/{{database}}/collectionGroups/{{collection}}/indexes/{{server_generated_id}}'

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Project

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Declaration
public Output<string> Project { get; }
Property Value
Type Description
Output<System.String>
View Source

QueryScope

The scope at which a query is run.

Declaration
public Output<string> QueryScope { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, IndexState, CustomResourceOptions)

Get an existing Index resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Index Get(string name, Input<string> id, IndexState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

IndexState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Index
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.