ravendb

Unit testing RavenDb queries

ε祈祈猫儿з 提交于 2019-12-22 05:23:53
问题 Is there a sensible way to stub/mock the results of a call to IDocumentSession.Query() ? I have a command where I'd like to verify that methods are called on objects (that is the "unit" being tested is the command NOT the objects the command orchestrates). I can't save Mock objects (via RhinoMocks) into an embedded db instance, so at the moment and being forced to verify state on the objects being called, rather than just verifying that the correct methods have been called. Thanks, Matt 回答1:

RavenDB and SignalR Nuget Package Dependency Conflict

谁说胖子不能爱 提交于 2019-12-22 04:04:49
问题 Basic conflict. SignalR wants Newtonsoft.Json version 4.0.7 or higher while RavenDB wants version equal to 4.0.5. Which obviously means they can't be installed side by side. So aside from downloading the source code from one of them and getting the dependencies figured out locally then have to check in the binary created from that, is there a possible way to keep the dependencies managed with NuGet, and maybe just forward the DLL Calls (like Mvc does with each new version for example)? 回答1:

Can't create new DB in RavenDB 2.x

时光总嘲笑我的痴心妄想 提交于 2019-12-21 17:23:57
问题 Noob RavenDB question: Just brought down Raven 2.x and set it up to run in IIS. Just trying to create a new DB in RavenDB 2.x through the Studio. I have the following set in my configuration: <add key="Raven/AnonymousAccess" value="All"/> I have the physical location set to allow Everyone full control. When I try to create a new database, I get the following: Could not get authorization for this command. If you should have access to this operation contact your admin and check the Raven

How to query items from nested collections in Raven DB?

孤街浪徒 提交于 2019-12-21 14:58:31
问题 I have following 2 entity models: public class Store : IModel { public string Id { get; set; } public string Name { get; set; } public string MainPageUrl { get; set; } public ICollection<Product> Products { get; set; } } public class Product : IModel { public string Id { get; set; } public string Name { get; set; } public double Price { get; set; } public DateTime Created { get; set; } } and of these Store is a document in my Raven Db. I need to create an index where I can query products by

Multi-tenanted DB. Strategy for Document ID and authorization

∥☆過路亽.° 提交于 2019-12-21 06:39:43
问题 I'm weighing up having separate DBs (one per company) vs one multi-tenanted DB (with all companies). Criteria: A user can belong to one company only and can't access documents of other companies. An administrator of the system needs to maintain DBs for all firms. Number of companies/tenants - from hundreds to tens of thousands There is one entry point with authentication, for all companies/tenants (it'll resolve the tenant and address it to the right DB). Question #1 . Are there any "good

Searching by Entity Name and Last Modified Date

风流意气都作罢 提交于 2019-12-21 06:24:41
问题 I have a number of commands stored in RavenDb and they all implement ICommand. I want to be able to search on the metadata of last modified and Raven-Entity-Name. I am currently doing a multi map on each command as below: public class CommandAuditSearch_Index : AbstractMultiMapIndexCreationTask<CommandAuditSearch_Index.Results> { public class Results { public string CommandType { get; set; } public DateTime LastModified { get; set; } } public CommandAuditSearch_Index() { AddMap

RavenDb on Azure Websites - Access Denied

萝らか妹 提交于 2019-12-21 04:58:18
问题 I'm playing around with the new Websites feature on Azure and trying to get an MVC site running with RavenDB in embedded mode. Everything works fine locally but running the deployed site in azure I get this error: System.Net.NetworkInformation.NetworkInformationException: Access is denied This happens when I create the db instance in global.asax: Store = EmbeddableDocumentStore { ConnectionStringName = "RavenDb" }; My connection string is: <add name="RavenDb" connectionString="DataDir=~\App

RavenDB Attachments - Functionality how to do?

拜拜、爱过 提交于 2019-12-20 23:05:13
问题 I have a file input control. <input type="file" name="file" id="SaveFileToDB"/> Lets say I browse to C:/Instruction.pdf document and click on submit. On Submit, I want to save the document in RavenDB and also later retrieve it for download purposes. I saw this link http://ravendb.net/docs/client-api/attachments that says.. do this.. Stream data = new MemoryStream(new byte[] { 1, 2, 3 }); documentStore.DatabaseCommands.PutAttachment("videos/2", null, data, new RavenJObject {{"Description",

Substring search in RavenDB

杀马特。学长 韩版系。学妹 提交于 2019-12-20 19:50:52
问题 I have a set of objects of type Idea public class Idea { public string Title { get; set; } public string Body { get; set; } } I want to search this objects by substring. For example when I have object of title " idea ", I want it to be found when I enter any substring of " idea ": i, id, ide, idea, d, de, dea, e, ea, a . I'm using RavenDB for storing data. The search query looks like that: var ideas = session .Query<IdeaByBodyOrTitle.IdeaSearchResult, IdeaByBodyOrTitle>() .Where(x => x.Query

The installer has encountered an unexpected error installing this package - .Error code 2896

我的未来我决定 提交于 2019-12-20 07:29:14
问题 I am currently trying to install ravendb on a prod server. The licens file I am using, is the same being used for another test/prod server. The installation seem to chrash all the time when i pass the license file to the installation. Something i found interesting in the log file was this. Action start 08:14:02: OpenLicenseFileChooser. MSI (c) (AC:A8) [08:14:02:763]: Invoking remote custom action. DLL: C:\Users\prod\AppData\Local\Temp\MSI7901.tmp, Entrypoint: OpenLicenseFileChooser MSI (c)