ravendb

RavenDB multi map

大兔子大兔子 提交于 2019-12-20 03:24:21
问题 I have a DB containing many tables, and every table has different properties, and I want to achive the following: Create and index on all of the properties (from every table). The problem is that I don't have a class for every table for I have used dynamic classes to insert them to the DB. So how can I create an index that given a string will return all documents that one of their properties contains that string? Another problem needed to be solved is that in future Tables insertion I can add

RavenDB Embedded on Azure Websites - Access Denied

拥有回忆 提交于 2019-12-19 03:23:15
问题 I get an Access denied message when I try to deploy my MVC4 site with an Embedded instance of RavenDB to the new Azure Websites preview feature. The site works fine locally. Here is how I configure Raven: //Initialize the RavenDB Data Store Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8887); var documentStore = new EmbeddableDocumentStore() { DataDirectory = "~\\App_Data", UseEmbeddedHttpServer = true, Configuration = { Port = 8887 } }; documentStore.Initialize();

RavenDB - retrieving part of document

大憨熊 提交于 2019-12-18 18:56:22
问题 I am playing with Raven DB for few days and I would like to use it as a storage for my Web chat application. I have document which contains some user data and chat history - which is big collection chat messages. Each time I load user document chat history is also loaded, even if I need only few fields like: user name, password and email. My question is: how to load only part of document from database ? 回答1: Tomek, You can't load a partial document, but you can load a projection. session

RavenDB - retrieving part of document

混江龙づ霸主 提交于 2019-12-18 18:56:22
问题 I am playing with Raven DB for few days and I would like to use it as a storage for my Web chat application. I have document which contains some user data and chat history - which is big collection chat messages. Each time I load user document chat history is also loaded, even if I need only few fields like: user name, password and email. My question is: how to load only part of document from database ? 回答1: Tomek, You can't load a partial document, but you can load a projection. session

RavenDB how to flush?

杀马特。学长 韩版系。学妹 提交于 2019-12-18 13:25:14
问题 I am using RavenDb embedded. As a part of my intergration tests I want to check objects are persisted. When I SaveChanges on an object, then retrieve it, it cannot be found unless I dispose my connection. This does not work for me, as no files are returned using (var session = _dataDocumentStore.Instance.OpenSession()) { session.Store(file); session.SaveChanges(); } .... using (var session = _dataDocumentStore.Instance.OpenSession() ) { return session.Query<File>().ToList(); } I created a

RavenDb : Force indexes to wait until not stale whilst unit testing

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 22:46:14
问题 When unit testing with RavenDb, it is often the case that newly added data is retrieved or otherwise processed. This can lead to 'stale index' exceptions e.g. Bulk operation cancelled because the index is stale and allowStale is false According to a number of answers How should stale indexes be handled during testing? WaitForNonStaleResults per DocumentStore RavenDb : Update a Denormalized Reference property value The way to force the database (the IDocumentStore instance) to wait until its

Proper Way to Retrieve More than 128 Documents with RavenDB

北慕城南 提交于 2019-12-17 21:53:34
问题 I know variants of this question have been asked before (even by me), but I still don't understand a thing or two about this... It was my understanding that one could retrieve more documents than the 128 default setting by doing this: session.Advanced.MaxNumberOfRequestsPerSession = int.MaxValue; And I've learned that a WHERE clause should be an ExpressionTree instead of a Func, so that it's treated as Queryable instead of Enumerable. So I thought this should work: public static List<T>

Raven DB 4.1.2 hangs on streaming query in Java

眉间皱痕 提交于 2019-12-14 03:06:05
问题 I have a jax-rs-based REST service that I run on Tomcat 8.5 on 64bit Linux, using Java 11; this service connects to a RavenDB 4.1.2 instance, also on the same Linux machine. I make use of the streaming query to return the request result. I use Postman to submit the same request, and everything works well: the results are returned, and rather quickly. However - it only works 10 times. When I submit the same request as previously an 11th time, the results = currentSession.advanced().stream

RavenDB for Music Database

五迷三道 提交于 2019-12-14 02:35:53
问题 I need your advice whether RavenDB would be suitable for building a Music Database. I would like to use the embedded version in a C# Windows Application. Currently the database is based on SQL with normalisation in place, having tables for e.g. Artist, Album, Genre, Share (main folder of music collection), Folder, Song and then a bunch of tables to build the relations like AlbumArtist, GenreSong, ArtistSong, ComposerSong, ConductorSOng, etc. I think you'll get it. Now with RavenDB I could

RavenDB OrderBy

爱⌒轻易说出口 提交于 2019-12-14 01:15:19
问题 In my C# application, I have a collection of objects which have an int Order property ranging from 1 to n . When I do like this: var listings = session.Query<Listing>().Where(x => !x.IsDeleted && x.CategoryId == category.Id && x.WorkflowStatus == WorkflowStatus.Published).OrderBy(x => x.Order); I get a collection of listings but not 100% in the correct order. As it stands the order goes: 0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 28, 29, 3, 30, 31, 32, 33, 4