document-database

Absorbing N in a M:N relationship

人走茶凉 提交于 2021-01-29 03:44:29
问题 I am encountering an issue I am trying to wrap my head around. I am using learnmongodbthehardway as a resource to define my options modelling a M:N relationship. According to this link I have two options: One way embedding and Two way embedding. I’d like to add a third option to this list called absorption. Absorption takes place when it makes no sense to implement one of the entity’s on its own. It might never be queried for example. An example of this can be extracted from the following

Absorbing N in a M:N relationship

旧城冷巷雨未停 提交于 2021-01-29 03:36:05
问题 I am encountering an issue I am trying to wrap my head around. I am using learnmongodbthehardway as a resource to define my options modelling a M:N relationship. According to this link I have two options: One way embedding and Two way embedding. I’d like to add a third option to this list called absorption. Absorption takes place when it makes no sense to implement one of the entity’s on its own. It might never be queried for example. An example of this can be extracted from the following

MongoDB document design for comments (and their reply comments)

a 夏天 提交于 2020-02-27 11:04:45
问题 I have a model that looks like: class Comment { public string ID { get; set; } public string ArticleType { get; set; } public string ArticleID { get; set; } public string Body { get; set; } public DateTime DateCreated { get; set; } public string UserID { get; set; } } I am creating an app to store comments about other stuff in our application For example, if the comment was regarding a product, the ArticleType could be “product” and the ArticleID would be the product id... I am going to use

MongoDB document design for comments (and their reply comments)

夙愿已清 提交于 2020-02-27 11:04:10
问题 I have a model that looks like: class Comment { public string ID { get; set; } public string ArticleType { get; set; } public string ArticleID { get; set; } public string Body { get; set; } public DateTime DateCreated { get; set; } public string UserID { get; set; } } I am creating an app to store comments about other stuff in our application For example, if the comment was regarding a product, the ArticleType could be “product” and the ArticleID would be the product id... I am going to use

How to index related documents in reverse direction in Ravendb

狂风中的少年 提交于 2019-12-23 01:36:12
问题 In Example II of Indexing Related Documents, an index is built over Authors by Name and Book title. The relevant entities look like so: public class Book { public string Id { get; set; } public string Name { get; set; } } public class Author { public string Id { get; set; } public string Name { get; set; } public IList<string> BookIds { get; set; } } I.e. only the Author holds information about the relation. This information is used in constructing said index. But how would I construct an

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

£可爱£侵袭症+ 提交于 2019-12-18 10:09:45
问题 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

Pros/cons of document-based databases vs. relational databases

我怕爱的太早我们不能终老 提交于 2019-12-17 06:24:21
问题 I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay (better description here). And I'm begining to think that a Document-based database isn't the best choice to address these requirements. Furthermore, I can't imagine a use for a Document based database (maybe my imagination is too limited). Can you explain to me

Pros/cons of document-based databases vs. relational databases

依然范特西╮ 提交于 2019-12-17 06:23:12
问题 I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay (better description here). And I'm begining to think that a Document-based database isn't the best choice to address these requirements. Furthermore, I can't imagine a use for a Document based database (maybe my imagination is too limited). Can you explain to me

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

吃可爱长大的小学妹 提交于 2019-12-12 07:26:05
问题 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

How to set a field containing unique key

孤街醉人 提交于 2019-12-10 11:39:53
问题 I want to save data in CouchDB documents and as I am used to doing it in RDBMS. I want to create a field which can only contain a unique value in the database. If I now save a document and there is already a document with unique key I expect an error from CouchDB. I guess I can use the document ID and replace the auto generated doc-id by my value, but is there a way to set other field as unique key holder. Any best practice regarding unique keys? 回答1: As you said, the generated _id is