document-database

RavenDB. How to load document with only 5 items from inner collection?

孤者浪人 提交于 2019-12-04 07:27:07
Here is a document in the store: { "Name": "Hibernating Rhinos", "Employees": [ { "Name": "Ayende" }, { "Name": "John" }, { "Name": "Bob" }, { "Name": "Tom" }, { "Name": "Lane" }, { "Name": "Bill" }, { "Name": "Tad" } ] } It is easy to load this document with or without Employees collection, but how to load only part of inner collection? For instance, first 5 items: { "Name": "Hibernating Rhinos", "Employees": [ { "Name": "Ayende" }, { "Name": "John" }, { "Name": "Bob" }, { "Name": "Tom" }, { "Name": "Lane" } ] } Ayende Rahien Not directly, not. What you can do is define the following index:

Should I denormalize or run multiple queries in DocumentDb?

旧街凉风 提交于 2019-12-04 02:23:39
I'm learning about data modeling in DocumentDb. Here's where I need some advice Please see what my documents look like down below. I can take two approaches here both with pros and cons. Scenario 1: If I keep the data denormalized (see my documents below) by keeping project team member information i.e. first, last name, email, etc. in the same document as the project, I can get the information I need in one query BUT when Jane Doe gets married and her last name changes, I'd have to update a lot of documents in the Projects collection. I'd also have to be extremely careful in making sure that

When developing web applications when would you use a Graph database versus a Document database?

夙愿已清 提交于 2019-12-03 13:13:32
I am developing a web-based application using Rails. I am debating between using a Graph Database, such as InfoGrid, or a Document Database, such as MongoDB. My application will need to store both small sets of data, such as a URL, and very large sets of data, such as Virtual Machines. This data will be tied to a single user. I am interested in learning about peoples experiences with either Graph or Document databases and why they would use either of the options. Thank you I don't feel enough experienced with both worlds to properly and fully answer your question, however I'm using a document

“Could not find transactional storage type” error with embedded RavenDB

白昼怎懂夜的黑 提交于 2019-12-01 02:26:58
I was able to successfully run a simple test for RavenDB based on the code found at: http://ravendb.net/tutorials/hello-world Next I tried to run it in an Embedded Manner, but I keep on getting the following error: Message: Could not find transactional storage type: Raven.Storage.Esent.TransactionalStorage, Raven.Storage.Esent StackTrace: at Raven.Database.Config.InMemoryRavenConfiguration.CreateTransactionalStorage(Action notifyAboutWork) in c:\Builds\raven\Raven.Database\Config\InMemoryRavenConfiguration.cs:line 272 at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration

Storing null vs not storing the key at all in MongoDB

余生颓废 提交于 2019-11-29 22:50:42
It seems to me that when you are creating a Mongo document and have a field {key, value} which is sometimes not going to have a value, you have two options: Write {key, null} i.e. write null value in the field Don't store the key in that document at all Both options are easily queryable, in one you query for {key : null} and the other you query for {key : {$exists : false}} . I can't really think of any differences between the two options that would have any impact in an application scenario (except that option 2 has slightly less storage). Can anyone tell me if there are any reasons one would

Most efficient method for persisting complex types with variable schemas in SQL

此生再无相见时 提交于 2019-11-29 22:01:24
问题 What I'm doing I am creating an SQL table that will provide the back-end storage mechanism for complex-typed objects. I am trying to determine how to accomplish this with the best performance. I need to be able to query on each individual simple type value of the complex type (e.g. the String value of a City in an Address complex type). I was originally thinking that I could store the complex type values in one record as an XML, but now I am concerned about the search performance of this

Document Databases: Redundant data, references, etc. (MongoDB specifically)

眉间皱痕 提交于 2019-11-29 20:22:25
It seems like I run into lots of situations where the appropriate way to build my data is to split it into two documents. Let's say it was for a chain of stores and you were saving which stores each customer had visited. Stores and Customers need to be independent pieces of data because they interact with plenty of other things, but we do need to relate them. So the easy answer is to store the user's Id in the store document, or the store's Id in the user's document. Often times though, you want to access 1-2 other pieces of data for display purposes because Id's aren't useful. Like maybe the

What are some good, fast persistent storage options for key->value data? [closed]

烂漫一生 提交于 2019-11-29 01:42:10
For a small PHP app I am writing, we need to store a large number of records that have a hash key, and a few simple field values ('host', 'path'). eg: '4420ffb32a' => array( 'host' => '127.0.0.1', 'path' => 'path/to/resource', ); What is the best persistent storage for data like this? Would MySQL be the best choice, or is it overkill for such simple data? What would give the best performance? Short answer: Membase . Long answer: You basically have three options: a relational database, file storage, or something else. Like you said, a relational database could definitely be overkill. That said,

Storing null vs not storing the key at all in MongoDB

落花浮王杯 提交于 2019-11-28 19:41:26
问题 It seems to me that when you are creating a Mongo document and have a field {key, value} which is sometimes not going to have a value, you have two options: Write {key, null} i.e. write null value in the field Don't store the key in that document at all Both options are easily queryable, in one you query for {key : null} and the other you query for {key : {$exists : false}} . I can't really think of any differences between the two options that would have any impact in an application scenario

How would I model data that is heirarchal and relational in a document-oriented database system like RavenDB?

。_饼干妹妹 提交于 2019-11-28 19:20:08
问题 Document oriented databases (particularly RavenDB) are really intriguing me, and I'm wanting to play around with them a bit. However as someone who is very used to relational mapping, I was trying to think of how to model data correctly in a document database. Say I have a CRM with the following entities in my C# application (leaving out unneeded properties): public class Company { public int Id { get; set; } public IList<Contact> Contacts { get; set; } public IList<Task> Tasks { get; set; }