ravendb

How-to create index on multiple documents with reducing

99封情书 提交于 2019-12-04 14:33:08
I've the following documents : public class User { public string Id { get; set; } public string Email { get; set; } public string Password { get; set; } } public class Book { public string Id { get; set; } public string Title { get; set; } } public class BookFavorite { public string Id { get; set; } public string UserId { get; set; } public string BookId { get; set; } } I want to query the list of books and have an information on each book if user has it in favorite. Actually a result like this : public class QueryResult { public Book Book { get; set; } public User User { get; set; } public

RavenDb : Update a Denormalized Reference property value

回眸只為那壹抹淺笑 提交于 2019-12-04 14:11:08
问题 I have implemented the RavenDB Denormalized Reference pattern. I am struggling to wire together the static index and the patch update request required to ensure that my denormalized reference property values are updated when a referenced instance value is changed. Here is my Domain: public class User { public string UserName { get; set; } public string Id { get; set; } public string Email { get; set; } public string Password { get; set; } } public class UserReference { public string Id { get;

How do I install and setup the RavenDb index replication

前提是你 提交于 2019-12-04 13:08:44
问题 rI've looked at the questions and indeed the RavenDb docs. There's a little at RavenDb Index Replication Docs but there doesn't seem any guidance on how/when/where to create the IndexReplicationDestination Our use case is very simple (it's a spike). We currently create new objects (Cows) and store them in Raven. We have a couple of queries created dynamically using LINQ (e.g. from c in session.Query<Cows> select c ). Now I can't see where I should define the index to replicate. Any ideas? I

Ravendb mapreduce grouping by multiple fields

自闭症网瘾萝莉.ら 提交于 2019-12-04 11:59:36
问题 We have a site that contains streaming video and we want to display three reports of most watched videos in the last week, month and year (a rolling window). We store a document in ravendb each time a video is watched: public class ViewedContent { public string Id { get; set; } public int ProductId { get; set; } public DateTime DateViewed { get; set; } } We're having trouble figuring out how to define the indexes / mapreduces that would best support generating those three reports. We have

Membership reboot replace Ninject with Simple Injector

谁都会走 提交于 2019-12-04 10:36:08
I need add membership reboot (RavenDb) into the project that use IOC Simple Injector Ninject implementation var config = MembershipRebootConfig.Create(); kernel.Bind<MembershipRebootConfiguration<HierarchicalUserAccount>>().ToConstant(config); kernel.Bind<UserAccountService<HierarchicalUserAccount>>().ToSelf(); kernel.Bind<AuthenticationService<HierarchicalUserAccount().To<SamAuthenticationService<HierarchicalUserAccount>>(); kernel.Bind<IUserAccountRepository<HierarchicalUserAccount>>().ToMethod(ctx => new BrockAllen.MembershipReboot.RavenDb.RavenUserAccountRepository("RavenDb")); kernel.Bind

Perform Async operation asp.net mvc outside of the action

。_饼干妹妹 提交于 2019-12-04 09:41:26
问题 I want to be able to load a user from a cloud database on each request and have that available on the request in a controller using asp.net mvc. The problem is the current framework does not support doing async operations from action filters. So OnActionExecuting, OnAuthorization methods do not allow me to do this.. for example I have the following code which DOES NOT work (so don't try it).. You get an exception : "An asynchronous module or handler completed while an asynchronous operation

Data access architectures with Raven DB

∥☆過路亽.° 提交于 2019-12-04 09:16:16
问题 What data access architectures are available that I can use with Raven DB? Basically, I want to separate persistence via interfaces, so I don't expose underline storage to the upper layers. I.e. I don't want my domain to see IDocumentStore or IDocumentSession which are from Raven DB. I have implemented the generic repository pattern and that seems to work. However, I am not sure that is actually the correct approach. Maybe I shall go towards command-query segregation or something else? What

Does Mongo DB have an In-Memory mode? [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-04 09:08:58
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Embedded MongoDB when running integration tests I want to use In-Memory mode for unit test, is there an in In-Memory mode like RavenDB? 回答1: There is no in-memory mode for MongoDB. As per this link, this feature won't be included until at least MongoDB 2.8. Though since it's using Memory-mapped IO, it should be as speedy as in-memory during the actual processing. Not the startup though. Also, there's a hack to

Raven DB: How can I delete all documents of a given type

送分小仙女□ 提交于 2019-12-04 08:20:53
问题 More specifically in Raven DB, I want to create a generic method with a signature like; public void Clear<T>() {... Then have Raven DB clear all documents of the given type. I understand from other posts by Ayende to similar questions that you'd need an index in place to do this as a batch. I think this would involve creating an index that maps each document type - this seems like a lot of work. Does anyone know an efficient way of creating a method like the above that will do a set delete

Raven DB Count Queries

早过忘川 提交于 2019-12-04 08:16:29
I have a need to get a Count of Documents in a particular collection : There is an existing index Raven/DocumentCollections that stores the Count and Name of the collection paired with the actual documents belonging to the collection. I'd like to pick up the count from this index if possible. Here is the Map-Reduce of the Raven/DocumentCollections index : from doc in docs let Name = doc["@metadata"]["Raven-Entity-Name"] where Name != null select new { Name , Count = 1} from result in results group result by result.Name into g select new { Name = g.Key, Count = g.Sum(x=>x.Count) } On a side