サーバーモードでRavendBを実行するためにどのような許可を付与する必要がありますか?

StackOverflow https://stackoverflow.com/questions/2829652

  •  26-09-2019
  •  | 
  •  

質問

Ravendbに関するRob Ashtonの優れたブログ投稿を読んでいます:http://codeofrob.com/archive/2010/05/09/ravendb-an-introduction.aspx

そして、私が読んだように、私はコードを通して働いています。しかし、インデックスを追加しようとすると、401エラーが表示されます。これがコードです:

class Program
{
    static void Main(string[] args)
    {
        using (var documentStore = new DocumentStore() { Url = "http://localhost:8080" })
        {

            documentStore.Initialise();

            documentStore.DatabaseCommands.PutIndex(
                "BasicEntityBySomeData",
                new IndexDefinition<BasicEntity, BasicEntity>()
                {
                    Map = docs => from doc in docs
                                  where doc.SomeData != null
                                  select new
                                  {
                                      SomeData = doc.SomeData
                                  },
                });


            string entityId;

            using (var documentSession = documentStore.OpenSession())
            {
                var entity = new BasicEntity()
                {
                    SomeData = "Hello, World!",
                    SomeOtherData = "This is just another property",
                };

                documentSession.Store(entity);
                documentSession.SaveChanges();

                entityId = entity.Id;

                var loadedEntity = documentSession.Load<BasicEntity>(entityId);
                Console.WriteLine(loadedEntity.SomeData);

                var docs = documentSession.Query<BasicEntity>("BasicEntityBySomeData")
                    .Where("SomeData:Hello~")
                    .WaitForNonStaleResults()
                    .ToArray();

                docs.ToList().ForEach(doc => Console.WriteLine(doc.SomeData));

                Console.Read();
            }

        }
    }

putindex()を呼び出す行を行うと、401エラーがスローされます。私が適用するために必要な許可はどのようなアイデアですか?そして、どこでそれらを適用する必要がありますか?

役に立ちましたか?

解決

サーバーモードとはどういう意味ですか? Raven.serverを実行するだけですか?

私はそれを機能させるために特別なクライアント側に何もする必要はありませんでしたが、私はRaven.Serverを走らなければなりませんでした。 (実際、メーリングリストでそれについての質問を提起します)

Raven.serverの構成を変更しない限り、401エラーを取得しないでください。

サーバーを実行している場合は、構成で指定されたURL(デフォルトではLocalHost:8080)を使用して直接閲覧できます。トラブルシューティングを続行する前に、実際に実行して動作していることを確認してください

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top