ravendb

Managing RavenDb session in Windsor under NServiceBus

佐手、 提交于 2019-12-06 03:19:32
问题 I'm using NServiceBus (3.2.2), RavenDB (1.2.2017-Unstable) and Windsor (3.0.0.4001) in an MVC 4 project. I have a IHandleMessages class that handles 3 different messages, and that needs an IDocumentSession, and therefore defines a property such as: public IDocumentSession DocumentSession { get; set; } I've copied the RavenDbUnitOfWork implementation from NServiceBus' website I've registered IDocumentStore, IDocumentSession and IManageUnitsOfWork in my Windsor container as follow: container

RavenDB: How can I prevent high RAM utilization?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 03:16:47
My application includes a few queries which return large result sets (although I've capped it with a Take(300) lambda. During peak usage times, I've seen Raven.Server.exe consume an unusually large amount of RAM. In fact, during these times, Raven.Server.exe can exhaust my server's available RAM. How can I avoid this situation? After a few Google searches, I can see that other people have encountered this error before me. But RavenDB has evolved during the past few years and there are many configuration and code options which can limit the amount of RAM that Raven.Server.exe can consume and

Raven DB - Have it Auto Generate its own Key

元气小坏坏 提交于 2019-12-06 02:44:49
问题 I current have an object that has a public property called Id. When I store the object, I would like the Id to be part of the Data and not become the document Id like it currently does. When creating the document store I only set the connection string. using (var session = documentStore.OpenSession()) { session.Store(a); session.SaveChanges(); } a can be thought of an object as: public class A { public Guid Id { get; set; } //other properties } So either I want it to generate a random Id or

RavenDB Query Suggest Multiple Words

杀马特。学长 韩版系。学妹 提交于 2019-12-06 00:09:45
I have some code that is searching a RavenDB database with the following index: public class Products_Search : AbstractIndexCreationTask<Product, Products_Search.Result> { public class Result { public string Query { get; set; } } public Products_Search() { Map = products => from product in products select new { Query = new { Categories = product.Categories.Boost(5), Brands = product.Brands.Boost(8), product.Description, Name = product.Name.Boost(10), product.SKU }, product.Price }; Index(x => x.Query, FieldIndexing.Analyzed); } } If I query against this like this (both strawberry protein are

How to synchronize changes in nosql db (ravendb)

别说谁变了你拦得住时间么 提交于 2019-12-05 21:40:16
I've started learning NoSQL on an example of RavenDB. I've started with a simplest model, let's say we have topics that were created by users: public class Topic { public string Id { get; protected set; } public string Title { get; set; } public string Text { get; set; } public DenormalizedUser User { get; set; } } public class DenormalizedUser { public string Id { get; set; } public string Name { get; set; } } public class User { public string Id { get; protected set; } public string Name { get; set; } public DateTime Birthdate { get; set; } //some other fields } We don't need the whole User

Ninject problem binding to constant value in MVC3 with a RavenDB session

主宰稳场 提交于 2019-12-05 18:28:32
I've seen a lot of different ways of configuring Ninject with ASP.NET MVC, but the implementation seems to change slightly with each release of the MVC framework. I'm trying to inject a RavenDB session into my repository. Here is what I have that's almost working. public class MvcApplication : NinjectHttpApplication { ... protected override void OnApplicationStarted() { base.OnApplicationStarted(); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); } protected override IKernel CreateKernel() { return new StandardKernel(new

Does multi map/reduce work in RavenDb?

吃可爱长大的小学妹 提交于 2019-12-05 16:18:20
I've read Ayende's blog post on the multi map feature of RavenDB and have tried to implement it. I cannot get it to work through. What I have is basically the same as the example in the blog post: class RootDocument { public string Id { get; set; } public string Foo { get; set; } public string Bar { get; set; } } public class ChildDocument { public string Id { get; set; } public string RootId { get; set; } public int Value { get; set; } } class RootsByIdIndex: AbstractMultiMapIndexCreationTask<RootsByIdIndex.Result> { public class Result { public string Id { get; set; } public string Foo { get

Finding objects which contains at least all elements from subset using RavenDB and LINQ

你离开我真会死。 提交于 2019-12-05 16:09:26
I have simple type Question : public class Question { public Question(string id) { Id = id; Tags = new List<string>(); } public string Id { get; private set; } public IList<string> Tags { get; set; } } I have defined sample collection of such questions: var q1 = new Question("q1") { Tags = new List<string>() {"aa", "bb"} }; var q2 = new Question("q2") { Tags = new List<string>() {"aa"} }; var q3 = new Question("q3") { Tags = new List<string>() {"aa", "bb", "cc"} }; var q4 = new Question("q4"); var questions = new List<Question>() {q1, q2, q3, q4}; Now I need to find all questions, which

RavenDB Include - Session.Load<T>(string[] ids)

[亡魂溺海] 提交于 2019-12-05 15:58:20
Is there a reason why I can't perform an Include to include a collection of documents from a query, then load them all in one query, rather than using a for-loop. var messages = Session.Query<MessageRecipient, MessageInboxIndex>() .Include(x => x.MessageId) .ToList(); Session.Load<Message>(messages.Select(x => x.MessageId)); This seems to go back to the database to fetch the objects rather than use the cache...is this by design or can it be fixed? Paul Paul, I just submitted a pull-request for that. I guess you will find this in one of the upcoming builds. Paul, That is because the

RavenDB Session > 30

不想你离开。 提交于 2019-12-05 11:12:33
问题 If I'm trying to save a list of items I want to save that has a count > 30 I get an error saying The maximum number of requests (30) allowed for this session has been reached. Raven limits the number of remote calls that a session is allowed to make as an early warning system. Sessions are expected to be short lived, and Raven provides facilities like Load(string[] keys) to load multiple documents at once and batch saves. What can I do to get around this? The problem with this error is I'm