标签: ravendb

RavenDB错误:日志文件版本与Jet版本不兼容

所以我使用以下指令在Win2003服务器上安装了RavendDB:

http://old.ravendb.net/documentation/docs-deployment-iis

当我尝试浏览到该网站时,我收到以下错误.有任何想法吗?

Version of log file is not compatible with Jet version 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Microsoft.Isam.Esent.Interop.EsentBadLogVersionException: Version of log file is not compatible with Jet version

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the …
Run Code Online (Sandbox Code Playgroud)

ravendb windows-2003-webserver

1
推荐指数
1
解决办法
1189
查看次数

不使用studio接口查询RavenDB

我试图在RavenDB管理工作室中查看我的传奇,并加载甚至是初始页面,我看到的只是这个"查询文档..."框,其中包含一个连续移动的进度条.我似乎无法超越它,从一页到另一页它不会消失.有没有办法将所有传奇数据拉入列表中,以便我可以查看它?问题似乎是传奇文件不断被添加.

我已经研究了HTTP API和Linq适配器,但我想我正在寻找一些已经存在的东西,可以很容易地进入服务器,就像Silverlight工作室一样,除了不那么痛苦.我或多或少只想将所有文档的快照拉成某种可读列表.

nservicebus ravendb

1
推荐指数
1
解决办法
463
查看次数

在RavenDB工作室查询时是否可以订购结果?

有时,我只是通过索引查看RavenDB工作室中的数据,我想知道是否有办法指定排序选项?

例如,如果我有这样的简单索引:

from doc in docs.Pages
select new
{
    Query = new[] { page.Text, page.Views },
    page,
    Views = page.Views
}
Run Code Online (Sandbox Code Playgroud)

如果我想查看stackoverflow大多数视图排序的文本中的所有页面,我将如何在RavenDB Studio中查询?

ravendb ravendb-studio

1
推荐指数
1
解决办法
822
查看次数

RavenDB获取ID列表?

在RavenDB中

我需要根据文档的ID获取文档的最新插入,并按列表中的ID进行过滤

即:

List<Entity> GetLastByIds(List<int> ids);
Run Code Online (Sandbox Code Playgroud)

该实体类似于:

class Entity
{
int id; //Unique identifier for the category the price applies to.
int Price; //Changes with time
DateTime Timestamp; //DateTime.UtcNow
}
Run Code Online (Sandbox Code Playgroud)

所以,如果我插入以下内容:

session.Store(new Entity{Id = 1, Price = 12.5});
session.Store(new Entity{Id = 1, Price = 7.2});
session.Store(new Entity{Id = 1, Price = 10.3});
session.Store(new Entity{Id = 2, Price = 50});
session.Store(new Entity{Id = 3, Price = 34});
...
Run Code Online (Sandbox Code Playgroud)

如何获得ID 1和3的最新价格?

我有Map/Reduce工作正常,给我最新的每个ID,这是我正在努力的过滤.我想在Raven中进行过滤,因为如果所有ID总共超过1024个价格点,那么在客户端进行过滤是没用的.

非常感谢我能得到的任何帮助.

非常感谢你提前:)

ravendb

1
推荐指数
1
解决办法
789
查看次数

RavenDB系统数据库在哪里物理存储?

这是物理存储在哪里?

我可以看到用户创建数据库的位置存储,如何找出存储系统数据库的数据?

c# database filesystems ravendb

1
推荐指数
1
解决办法
474
查看次数

检查控制字符

我想检查一个字符串以确保它不包含任何控制字符。我已经想出了这个解决方案。您是否同意它足以达到预期目的?有什么明显的我错过了吗?

\n\n
        string input = "2cancer\xef\xbc\x87.pdf";\n\n        char[] chars = input.ToCharArray();\n\n        foreach (var c in chars)\n        {\n            if(c == 127 || (c < \' \' && c != \'\\t\'))\n            {\n                throw new Exception("Control character detected");\n            }\n        }     \n
Run Code Online (Sandbox Code Playgroud)\n\n

其背景是将文件上传到 RavenDB 时出现问题,它抱怨文件名包含无效的控制字符,即 \xef\xbc\x87,所以我希望检测到无效的控制字符,然后将其删除或抛出警告用户的例外,尽管我可能会做前者。

\n\n

异常的堆栈跟踪是:

\n\n
    [ArgumentException: Specified value has invalid Control characters.\n    Parameter name: value]\n       System.Net.WebHeaderCollection.CheckBadChars(String name, Boolean isHeaderValue) +8426470\n       System.Net.WebHeaderCollection.Set(String name, String value) +86\n       Raven.Client.Connection.HttpJsonRequest.WriteMetadata(RavenJObject metadata) in c:\\Builds\\RavenDB-Stable\\Raven.Client.Lightweight\\Connection\\HttpJsonRequest.cs:573\n       Raven.Client.Connection.HttpJsonRequest..ctor(CreateHttpJsonRequestParams requestParams, HttpJsonRequestFactory factory) in c:\\Builds\\RavenDB-Stable\\Raven.Client.Lightweight\\Connection\\HttpJsonRequest.cs:91\n       Raven.Client.Connection.HttpJsonRequestFactory.CreateHttpJsonRequest(CreateHttpJsonRequestParams createHttpJsonRequestParams) in c:\\Builds\\RavenDB-Stable\\Raven.Client.Lightweight\\Connection\\HttpJsonRequestFactory.cs:57\n       Raven.Client.Connection.ServerClient.DirectPutAttachment(String …
Run Code Online (Sandbox Code Playgroud)

.net c# unicode ravendb

1
推荐指数
1
解决办法
3802
查看次数

在 RavenDb 中建立一对多模型以获得更好的性能

我正在接近文档数据库,但在以下情况下,我对如何映射文档关系有点困惑

public class Person
{
    public Person()
    {
    }
    public int Id { get; set; }
    public string Name { get;set;}
    public string Surname { get; set; }
    public DateTime? BirthDate { get; set; }
}


public class Car
{
    public Car() { }
    public int Id { get; set; }
    public string Name { get; set; }
    public int PersonId { get; set;}
}
Run Code Online (Sandbox Code Playgroud)

例如,一个人拥有一辆或多辆汽车,我可以按如下方式查询数据库

public Car Get(int id)
    {
        Car car = null;
        using (IDocumentSession session = store.OpenSession()) …
Run Code Online (Sandbox Code Playgroud)

c# relationship document-database ravendb

1
推荐指数
1
解决办法
404
查看次数

如何在 RavenDB 中没有给定索引的情况下删除集合?

我看到了通过查询删除集合实体的例子;
https://ravendb.net/docs/article-page/4.0/Csharp/client-api/operations/delete-by-query

但我的问题是,如何在不给出索引的情况下删除集合?

举个例子,我像这样创建/插入一个集合到RavenDB;

using (IDocumentSession session = _documentStore.OpenSession())
{
    session.Store<TEntity>(entity);
    session.SaveChanges();
}
Run Code Online (Sandbox Code Playgroud)

我没有创建任何索引。刚刚将一些数据存储到 RavenDB。我在 api 中查找了类似的东西;

using (IDocumentSession session = _documentStore.OpenSession())
{
    session.DeleteAll<TEntity>()
    session.SaveChanges();
}
Run Code Online (Sandbox Code Playgroud)

但这并不存在。那么如何在没有给定索引的情况下删除实体呢?

c# ravendb .net-core

1
推荐指数
1
解决办法
308
查看次数

从服务器获取数据库名称

I want to do a simple thing: get the database names on a RavenDB server. Looks straightforward according to the docs (https://ravendb.net/docs/article-page/4.1/csharp/client-api/operations/server-wide/get-database-names), however I'm facing a chicken-and-egg problem.

The problem comes because I want to get the database names without knowing them in advance. The code in the docs works great, but requires to have an active connection to a DocumentStore. And to get an active connection to a DocumentStore, is mandatory to select a valid database. Otherwise …

node.js ravendb

1
推荐指数
1
解决办法
68
查看次数

RavenDB:异步SaveChanges影响以后的更新?

作为学习RavenDB的一部分,我试图根据我每晚下载的列表更新一组股票.

我有一个Stock类,其中Id是股票代码:

public class Stock
{
    public string Id { get; set; }
    public StockStatus Status { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用此算法同步列表:

  1. 更新或插入现在下载的所有股票为"StillActive".
  2. 任何上次状态为"活跃"的股票意味着他们不在更新中,需要"删除".
  3. 所有股票仍然"StillActive"成为新的"活跃"股票.

这是实施:

List<Stock> stocks = DownloadStocks();

using (var session = RavenContext.Store.OpenSession())
{
    foreach (Stock stock in stocks)
    {
        stock.Status = StockStatus.StillActive;
        session.Store(stock);
    }

    session.SaveChanges();

    session.PatchUpdateCutoffNow("Stocks/ByStatus", "Status:Active", "Status", StockStatus.Deleted);
    session.PatchUpdateCutoffNow("Stocks/ByStatus", "Status:StillActive", "Status", StockStatus.Active);
}
Run Code Online (Sandbox Code Playgroud)

PatchUpdateCutoffNow是一个扩展方法,它使用Cutoff现在执行UpdateByIndex:

public static void PatchUpdateCutoffNow(this IDocumentSession session, string indexName, string query, string name, object val)
{
    session.Advanced.DatabaseCommands.UpdateByIndex(indexName, 
        new IndexQuery() { Query = query, …
Run Code Online (Sandbox Code Playgroud)

c# nosql ravendb

0
推荐指数
1
解决办法
1015
查看次数