ravendbravendb-studio

Can RavenDB create an index for a hyphenated collection name?


I'm trying to create an index from within RavenDB Studio for a collection named employee-tickets but I can't seem to find the correct syntax. Does anyone know the secret?

I've tried from t in docs["employee-tickets"] but that just complains with the following error:

Cannot apply indexing with [] to an expression of type

I know I could rename my entity but I simply don't want to :)


Solution

  • You sort of can, but it isn't recommended, you can use:

    from doc in docs
    where doc["@metadata"]["Raven-Entity-Name"] == "employee-tickets"
    // rest of index
    

    But I would recommend on using an identifier.