ravendb

Singleton for Embeded RavenDb

一曲冷凌霜 提交于 2019-12-25 05:25:27
问题 Why when I use this singleton the load retreive always null? public class DataLayer { private EmbeddableDocumentStore d; private static object lockerSingleton = new object(); private static DataLayer _current; public static DataLayer RavenDB { get { lock (lockerSingleton) { if (_current == null) _current = new DataLayer(); } return _current; } } public DataLayer() { d = new EmbeddableDocumentStore() { DataDirectory = "csv" }; d.Initialize(); } public void store<T>(T obj) { using (var session

Format exception - RavenDB LINQ query

跟風遠走 提交于 2019-12-25 05:14:52
问题 I am getting a input string format error in the following bit of code... While debugging code, this runs as a single line of code and so I am not able to dig deep into what might be causing the format exception.. can any one please point to me what I am doing wrong.. thank you. Exception: FormatException was unhandled by user code: "Input string was not in correct format" Code: store.DatabaseCommands.UpdateByIndex("Movies/NewIndexName", new IndexQuery { Query = string.Format("Status:Released

Search Query in RavenDB

五迷三道 提交于 2019-12-25 02:25:33
问题 I would like to know the Search Query for the below condition. I have created an index called MeetingEventIndex as below: public class MeetingEventIndex : AbstractIndexCreationTask<mngtMeetingEvent> { public MeetingEventIndex () { Map = docs => from d in docs select new {d.meetingroomid, d.text, d.details}; Index(x=>x.meetingroomid, FieldIndexing.Analyzed); Index(x=>x.text, FieldIndexing.Analyzed); Index(x=>x.details, FieldIndexing.Analyzed); } } I am trying to create a search query as below

Aggregating MoreLikeThis Results in RavenDB

情到浓时终转凉″ 提交于 2019-12-24 15:44:55
问题 I have been trying out the MoreLikeThis Bundle to bring back a set of documents ordered by the number of matches in a field called 'backyardigans' compared to a key document. This all works as expected. But what I would like to do is order by the number of matches of 3 separate fields added together. An example record would be: var data = new Data{ backyardigans = "Pablo Tasha Uniqua Tyrone Austin", engines = "Thomas Percy Henry Toby", pigs = "Daddy Peppa George Mummy Granny" }; If another

Get all of a collection's documents id's RavenDB for a “per-document” modification

北城以北 提交于 2019-12-24 10:28:06
问题 I'm currently trying to update my documents in a ravendb DB. The issue is that i have a method that updates one document, yet it takes as a parameter the id of the doc. I'm using python, therefore : pyravenDB as an interface. The method is the following : def updateDocument(self,id,newAttribute) with self.store.open_session() as session: doc = session.load(id) doc.newAttribute= newAttribute session.save_changes() My idea is the i will use a simple for loop with all the id's of the targeted

RavenDB Updated Class new property not getting serialised

倾然丶 夕夏残阳落幕 提交于 2019-12-24 09:57:34
问题 I am working with RavenDb and am stuck at a brick wall. I had an old class that I was persisting and it was all working fine. But during development I added an additional property to this class. Now when I persist the class all the old properties get persisted but the new property added is not appearing when I brows the repository using web browser. Is there anything specific that needs to be done if the class changes for raven to serialise this new property? I am on version 426. 回答1:

Raven DB Replication Setup Issue

柔情痞子 提交于 2019-12-24 03:07:34
问题 Can any one help me in setting up Raven DB Replication? Tried a lot of ways a lot of time but no success. Here is the story: 1) I downloaded the raven bundle. Make a copy of it. Run Raven.Server.Exe from both of the folders. Both instances run successfully on individual port. Then I created a document with name as "Raven/Replication/Destinations" and document as { "Destinations": [{"Url":"http://vishal-pc:8081"}], "Id": "Raven/Replication/Destinations" } But it's not working. Please some one

RavenDB Includes still round-tripping to load included data

我只是一个虾纸丫 提交于 2019-12-24 02:13:48
问题 I have a parent/child relationship between a ProductFamily (the parent) and a list of subordinates (SaleItem). I am running the Ravendb Server locally with the server pulled up as a console app. When I query the Family data I am attempting to include the list of SaleItems in the session to avoid extra trips to the server. However on the console I see the subsequent calls to load the individual saleitem list for each family as I step through the foreach loop. I think I am doing something

RavenDB Join Query

无人久伴 提交于 2019-12-24 02:08:43
问题 Given the following three documents in RavenDB public class Auction { public string Id; public DateTimeOffset? StartingOn; public DateTimeOffset? EndingOn; } public class Car { public string Id; public string Model; public string Make; public IEnumerable<string> EnlistedAuctions; } public class User { public string Id; public string Name; public IEnumerable<string> AvailableAuctions; } usecase: I want to retreive all Cars for a given User. i.e. join Car to User on their matching auctions.

Store reference to parent document instead of storing copy of document

岁酱吖の 提交于 2019-12-23 20:49:23
问题 In the classic case of Orders and OrderLines, each OrderLine has a reference to its parent Order. When I save my OrderLine to RavenDB, it saves a copy of the full Order record as a property of each OrderLine. How do I get it to save only the link to the Order instead? Like this: { ...other orderline properties... Order : "orders/123" } instead of this { ...other orderline properties... Order : { ...all properties for order 123... } } 回答1: Welcome to non-relational databases! Order lines don't